Design a Ticketmaster on-sale from an empty canvas: an event page, ticket holds and checkout that survive the second the sale opens, with scalper bots kept out.
Unlock it once for 25 credits; everything inside it is free (runs, changes, Submit, results, hints). Sign in with Google to start; new accounts get free credits.
What it must do
Show the event page with the tickets still available.
Let fans hold tickets for a few minutes while they pay; a ticket is never sold twice.
Admit fans to the hold step at a fixed rate when the sale opens (a virtual waiting room).
Stop scalper bots before they reach the inventory.
Take payment and email the tickets.
Scale
1,500 requests a second before the sale: 1,050 event-page views, 405 holds and 45 purchases.
When the sale opens, traffic jumps to 8× for 8 seconds: 12,000 requests a second, 3,240 of them holds.
Bots arrive at 5,000 requests a second, more than three times the real traffic.
Request types to route: event (70%, read), hold (27%, write), buy (3%, write). Budget: $68,000 a month.
Estimate first
Hold requests a second when the sale opens (8×) (req/s)
Fans a waiting room admitting 500 a second lets in during the 8 s burst (fans)
Payment gateway calls a month (million)
Monthly cloud cost of your design (USD)
The test cases
You start from an empty canvas. When you run the tests, each one simulates your design with its own traffic and failures:
Test
What it does
Passes when
Normal day
The normal day: the traffic in the brief, nothing broken.
Success ≥ 99%; p99 latency ≤ 300 ms (event); p99 latency ≤ 800 ms (hold); p99 latency ≤ 3.0 s (buy)
Tickets go on sale: 8× traffic
At 5 s the sale opens: traffic jumps to 8× normal for 8 s, almost all of it fans trying to hold tickets at once.
At 4 s one server of the first app service on the request path dies for 10 s.
Success ≥ 99%
Budget: $68,000/month
The normal day's design must cost at most $68,000 a month.
Cost ≤ $68,000/month
Must include
A virtual waiting room. A drop brings ten times more fans than the inventory can serve at once; a waiting room lets them in at a steady rate instead of letting the crowd knock it over.
Bot management. Scalper bots try to grab tickets faster than any person; they must be told apart from fans at the edge.
An inventory with holds. Every ticket is held by one fan at a time: an atomic hold in the inventory, guarded by a lock.
A payment gateway. Tickets are paid by card through a gateway.