All system design challenges
#46 Virtual Waiting Rooms

Ticketmaster Queue System

Sell 50,000 concert seats to two million people who arrive at the same second, fairly and without selling a seat twice.

Asked at Amazon Ticketmaster

What is being asked

A popular event goes on sale at a fixed time. Design the ticketing flow, in particular the virtual waiting room that protects the booking system, and the seat reservation that prevents double sales.

Requirements

Functional

  • Join a queue when sales open; be admitted in turn.
  • Choose seats, hold them for a few minutes, pay, receive tickets.

Non-functional

  • A spike far beyond what the booking system can serve.
  • No seat sold twice.
  • Seen as fair; resistant to scripted buyers.

Design

limited concurrencyBuyersCDN: staticwaiting-room pageQueue service (issuesposition tokens)Admission controllerBooking serviceSeat inventory storePayment service
Boxes are services; rounded shapes are data stores and queues.
  1. Before the sale, visitors wait on a static page served from a CDN. At opening, each receives a signed token with a queue position, assigned randomly among those already waiting.
  2. The page polls for its turn. The admission controller lets in only as many users as the booking system can handle, admitting more as others finish.
  3. An admitted user picks seats. The booking service places a hold on each seat with an expiry, using an atomic conditional write per seat.
  4. Payment within the hold time converts the hold into a sale. An expired hold returns the seats to the pool.

Key decisions and trade-offs

  • The waiting room turns a spike into a steady flow. The expensive, stateful system only ever sees the load it was sized for.
  • Random order for early arrivals removes the advantage of whoever has the fastest script at the opening second.
  • Hold length. Long holds make the event look sold out while seats are in abandoned baskets; short holds fail legitimate buyers during payment.
  • Per-seat conditional writes against a strongly consistent store are what prevent double sales; search and seat maps can be slightly stale.
  • Signed tokens bound to a session stop people sharing or forging a place in the queue.

Follow-up questions

  • How would you handle "best available" for a group of four together?
  • How do you limit tickets per person when accounts are easy to create?
  • What do you show users when seats return from expired holds?
  • How do you keep the queue itself from being the thing that falls over?
Log in to tick off the challenges you have worked through. Log in