Overview
Design a flash-sale engine (like Ticketmaster concert drops or Amazon Prime Day) where 100,000 items sell out in seconds to millions of concurrent buyers without overselling.
Requirements
- 1Handle extreme traffic spikes (1M+ concurrent users hitting the checkout endpoint at the exact drop second)
- 2Strict inventory guarantee: ZERO overselling (stock can never go negative)
- 3Temporary inventory reservation (hold item in cart for 10 minutes; auto-release if unpaid)
- 4Fairness & Bot prevention (Virtual Waiting Room / Queue token system)
- 5Seamless payment gateway integration with asynchronous order confirmation
Architecture Hints (4)
Target Concepts
#Redis Lua#Virtual Queue#Kafka#Inventory Lock#Concurrency