AlgoViz

Design Ticketmaster

hard 55 min

Sell numbered seats to far more people than there are seats.

Grow the design

Start with the smallest system that works. Change it only when something breaks.

Seven versions

Version 1: One service, one database

Forced by: The features: see seats and buy one.

Our systemFansTicket servicePostgreSQL
What changes
A seat is sold with one conditional update, after a card call.
What it costs
Almost nothing. The unique rule already prevents an oversell.
What breaks next
Two people type card details for one seat, and the loser learns it last.

Say: It is already correct. It is only unkind.

Architecture

High-level design

The whole system

Fans reach a CDN edge and a gateway. Browsing goes to the event service with a search index and Redis. A sale sends fans through the waiting room. Inventory holds seats in the seat database, checkout sells them and calls a card provider outside our system, and an event stream feeds tickets, e-mail and analytics.
Blue is browsing, orange the waiting room, pink holding and buying. Dashed means later.

One request through the system

  1. 1

    Client

    Map and countdown in the browser or app; bought tickets readable without a network.

  2. 2

    Edge

    Static files, waiting page, attack protection, first rate limits, nearest region.

  3. 3

    Balancer and gateway

    TLS, health checks, sign-in, the pass, limits, routing, a circuit breaker for each service behind it.

  4. 4

    Event service

    Search with filters and places, event pages, 60-second cache for results.

  5. 5

    Inventory

    Maps and holds. Reads for the map come from a published picture, decisions from rows.

  6. 6

    Waiting room

    Lobby, places, public number, passes.

  7. 7

    Checkout and payment

    The states of an order. Only the payment service talks to the provider, and card numbers never reach us.

  8. 8

    Workers

    Tickets, e-mail and push, capture, refunds, analytics, risk review.

The purchase alone

A shopper's checkout first goes to the card provider to authorise, then to the seat database to sell. The stream then tells workers to capture the money and send the tickets.

A seat's life

No arrow from paying is driven by a clock alone.

Flow 1: hold

Flow 2: buy

Flow 3: wait