Two fans click C-K-14 at once
Bad: Read, then write
Both read “free”, both write HELD. One seat, two tickets.
Good: One conditional UPDATE
Set HELD only if still free. The loser updates 0 rows and gets 409.
1M/s
requests if nothing stands in the way
Two million fans retrying every 2 seconds is about 70× the everyday peak, all aimed at one event’s rows.
Make the crowd wait where it can’t hurt you
Each fan gets a signed place in line, polls one cached number, then swaps it for a signed token. Nothing touches the inventory database.
200/s
fans admitted while two million wait
About 4 writes each is 800 a second on one event. If 40% buy, 3 tickets each, the show sells out in just over 4 minutes.
60,000 shoppers watch one map as seats change hundreds of times a second.
The trick
Don’t chase a perfect map. Push a numbered delta each second. The map is a hint; the hold is the check.
Your UPI payment lands two minutes after the window closes
Freeze seats as PAYING for 15 minutes. If money still lands late, confirm only if the seats are yours or free; otherwise refund.
Bots: make identity expensive before the sale
- Pre-register days ahead, invite a subset
- Check for bots once, at queue entry
- Bind each admission token to one account
- One active hold per account, capped hold time
Remember
Cache the browsing. Make every seat change one conditional statement. Let the crowd wait at the edge; the map is a hint, the hold is the check.