The flash sale
Keep checkout stable during a scheduled surge using admission control and queue buffering.
Kata overview
You do not need to be an expert to start. This kata keeps the stakes low so you can explore trade-offs, adjust the diagram, and see how the system responds.
Context for this system design kata
Keep checkout stable during a scheduled surge using admission control and queue buffering. This system design kata keeps the stakes low so you can rehearse trade-offs before taking ideas into production reviews.
Scenario and practice focus
Thursday at 12:00, the drop goes live. Within seconds, thousands of buyers hit the checkout. Traffic enters through a fast gateway, purchase intent lands on a queue, and orders process against the payment gateway at a rate it can handle. The payment gateway is external - it's fast when healthy but has limited capacity and can't be scaled. If too many requests hit it simultaneously, it slows and starts returning errors. Buyers need a fast "you're in the queue" acknowledgement, payments need to flow without overwhelming the gateway, and costs need to stay controlled during the brief, intense window.
Difficulty: Intermediate. Estimated time: 25–40 min. Domain: E-commerce.
Constraints to balance
Operational pressure
- No manual intervention during a drop.
- Payment gateway is external with limited capacity.
Customer and product constraints
- The drop window is short - cost must be controlled per-window, not monthly.
Scenarios to explore in the simulator
- Keep checkout acknowledgement fast during the surge.
- Process payments at a rate the payment gateway can sustain.
- Keep error rates very low - every failed checkout is a lost sale and an angry customer.
- Bound queue wait so buyers aren't left in limbo.
- Maintain cost discipline during the short, intense window.
Learning outcomes
- Combine admission control (gateway) with queue buffering to handle a scheduled surge.
- Separate acknowledgement from processing using accept vs processing latency targets.
- Use recovery queues to protect external payment dependencies.
- Balance queue depth against buyer wait time.
Give it a try!