Design Dream11's Contest Entry System for 5M Concurrent Joins at Match Start
Problem
Design the system that handles the massive spike of 5M users simultaneously joining contests in the minutes before a cricket match starts.
Requirements
Functional:
- User selects contest and submits team within deadline
- Contest has a max participant cap
- Show real-time fill percentage
- Late entries rejected after deadline
- Entry fee deducted from wallet atomically with join
Non-functional:
- 5M entries in 10 minutes = ~8K TPS
- No entry after deadline — hard cutoff
- No contest overfill — strong consistency on participant count
- Wallet debit must be atomic with contest join
Discussion points
- Distributed counter for contest fill count (Redis INCR + limit check)
- Preventing overfill under race conditions
- Queue-based entry processing to absorb spike
- Wallet debit + contest join as a distributed transaction (Saga pattern)
- Deadline enforcement: server-side clock + pre-rejection at edge
added …