Backend Engineering · System design · Hard
System design practice: World Cup Semi-final
One post, one link, a wall of traffic. World Cup Semi-final at ChaiCart. Traffic builds to about 22,000 requests a second. 3 things go wrong at once…
The problem
- World Cup Semi-final at ChaiCart. Traffic builds to about 22,000 requests a second. 3 things go wrong at once tonight. Keep 99% of customers served and stay within ₹7,550.
- Peak ≈ 22,000 req/s
- Quiet until 7:52 PM, then a jump to the peak in two minutes
- 60% of real traffic is the same offer page for everyone
- ⚠ Payments slow down from 7:44 PM. 16% of requests are checkouts
- From 8:00 PM: 40% of traffic is bots
You'll use: System design · Caching · CDN · Queues & workers · Database replicas · Rate limiting
Show a hint
Bots make far more requests than people. A rate limiter blocks them before you pay to serve them. Traffic that's identical for everyone (the offer page) belongs on the CDN. Set it up before the spike: servers take minutes to boot. Repeat reads of the same data belong in a cache, not in more database replicas. Don't make servers wait on slow payments: queue checkouts and let workers (~300/s each) handle them. Writes eat the main database's capacity. Move reads to a read replica so the primary can keep up.
What this teaches (spoiler)
Not all traffic deserves capacity: shed abusive clients at the door. Prepare for spikes you can see coming, and push identical content to the edge. Read-heavy traffic is a caching problem first: answer repeat reads from memory. Never let a slow third party hold your servers hostage. Queue the work and reply immediately. Reads and writes compete on the primary. When writes are heavy, replicas give reads their own room.