DealDash is an e-commerce platform running weekly flash sales. At exactly 8 PM every Thursday, 10,000 limited-edition items become available and typically sell out in under 60 seconds.
The challenge: 1 million users hit the "Buy Now" button within the first 10 seconds. You must ensure:
- No overselling - exactly 10,000 items are sold, never more.•Fairness - first-come-first-served with a transparent queue.•Resilience - the rest of the website (browsing, search, account) must remain functional even during the sale stampede.•Feedback - users get immediate confirmation ("secured!" or "sold out") within 3 seconds.
This is fundamentally a concurrency + consistency problem at extreme scale.
Design a flash sale system where 1 M users compete for 10,000 items in 60 seconds. Build this architecture under realistic production constraints, then validate tradeoffs in the design lab simulation.
Request path: The solution keeps ingress, service logic, and stateful dependencies separated so each layer can scale independently.
Reference flow: Web Clients -> Load Balancer -> API Gateway -> Rate Limiter -> API Service -> Primary SQL DB -> Read Model DB -> Redis Cache