Skip to content

Case study: Ticket booking (Ticketmaster)

Design a high-contention ticket booking system: virtual waiting rooms, two-phase seat holds with bounded TTLs, atomic conditional updates (`decrementIfPositive`), and fencing tokens.

35 min9 steps

By the end you can
  • Estimate stadium seat inventory memory, flash-crowd read vs write ratios, and waiting-room admission pacing
  • Prevent double-selling seats under contention using atomic conditional updates (`decrementIfPositive` / CAS) instead of read-then-write
  • Design a two-phase seat reservation protocol with bounded-TTL holds, active+lazy expiry, and fencing tokens
  • Predict system behaviour during hot front-row drops, seat-map refresh storms, and database leader failovers

Pin down what you are building

2M fans / 50k seats

  • Browse maps; fair waiting room; five-minute holds; payment confirmation

Zero oversell

  • Map <100ms; 2-5s staleness allowed; survive 100x spikes

Why does ticket booking split purchase into Phase 1 (a 5-minute temporary seat hold) and Phase 2 (payment confirmation), rather than charging the credit card first and assigning a seat afterward?

Answer this step to continue.