Room 1 of 3
Fire twelve payments at one account at the same moment, on the unsafe path and then the safe one.
| What is real | Twelve real HTTP requests, each a real database transaction. | Cloudflare D1 serialises writes, so the race sits in the application code rather than the engine, the same as in production. |
|---|---|---|
| What is staged | The company, the accounts and the amounts are invented. | The unsafe path reads a balance, awaits, then writes the sum it computed, the shape this bug takes in real code. |
| What this does not prove | Not that the safe path would hold at a real company's size. | This is a dozen requests against a free database, not a payments system under load. |