Skip to content

How to design Ticketmaster

The first sections are free. The deep dives, level expectations and quiz are part of Pro.

On this page
Practice this question

The problem

A ticket site shows events, lets a buyer pick seats on a map and takes their money. The hard part is that millions of people browse one popular event while a much smaller group tries to buy, and that smaller group wants the same seats in the same moment. The answer turns on two moves: a short hold on each chosen seat, with a time limit, so a buyer can pay without the seat being sold under them, and a gate in front of the booking path for the biggest on-sales so buyers reach the seat-hold store in batches rather than all at once.

Clarifying questions

AskWhy it mattersA typical answer

Are seats assigned, or is it general admission?

Assigned seats create a race on each seat, which is the whole booking problem. General admission is a single counter per event and a much smaller question.

Assigned seats: a buyer picks specific seats on a venue map and books those.

How big is the biggest on-sale, and how do views compare with bookings?

It tells you whether the read path needs a cache and whether the booking path needs a gate in front of it.

About 10 million users on one popular event the moment sales start, with reads outnumbering bookings about 100 to 1.

How long may a buyer hold seats while paying?

The hold length sets the time limit on the seat hold and decides how long an abandoned cart keeps a seat off the market.

Seats are held for 10 minutes; after that they go back on sale.

Who takes the payment?

With an outside processor whose hosted fields take the card, we handle holds and confirmation, not card data, and it introduces a callback we have to make safe to repeat.

A payment provider such as Stripe. We create the payment and confirm the booking when the provider tells us it went through.

Does search have to cope with typos, and how fast must it answer?

A typo-tolerant search usually means a search index outside the main database, which is a trade-off worth naming early.

Yes: a misspelled artist name should still find the event, and results should come back in under 500 ms.

Does the seat map have to update live for everyone?

A live map for millions of viewers is expensive, and for the biggest events it may be worth giving up. Knowing the expectation early lets you say so later.

The map must be viewable. How live it is for the biggest events is your call; say what buyers lose if it isn't.

Are past bookings, event administration and pricing in scope?

Each can be built apart from booking, and naming them as out of scope saves time for the booking path.

No. Viewing past bookings, admins adding events and dynamic pricing are all out of scope.

The requirements menu

RequirementScopeWhy

View an event and its seat map

Core

The read path and most of the traffic. It also decides what a buyer sees while another buyer is holding a seat.

Search for events

Core

A main way buyers find an event. It brings in the question of where the search index lives and how fresh it is.

Book tickets for chosen seats

Core

The write path and the part most of the deep questions are about: holding seats, paying, and confirming without selling a seat twice.

Free seats when a buyer walks away from checkout

Optional

Worth taking: it falls straight out of the hold design, and saying how an abandoned cart gives its seats back shows the hold has a time limit for a reason.

A waiting room for the biggest on-sales

Optional

Take it when the huge on-sale comes up, as it does in this question's deep dives. It is the answer to how the booking path survives millions of buyers at once.

A seat map that updates as seats are held and sold

Optional

Nice for buyers, and workable at moderate demand. For the biggest on-sales it becomes a large push fan-out, so name it and be ready to drop it for those events.

A limit on tickets per buyer, and bot detection

Optional

Mention it when the on-sale comes up: a per-account limit is one database check, while telling bots from fans is its own program and belongs at the gate, not in booking.

Refunds, transfers and resale

Out of scope

A second marketplace on top of the first. Say that a confirmed booking is the record a refund would reverse, and move on.

Email or text confirmation after purchase

Out of scope

A notification pipeline fed by the confirmed booking. Nothing in the booking path depends on it.

Viewing past bookings

Out of scope

Ordinary reads of the bookings table by user id. Keep a user id on each booking and stop there.

Admins adding events

Out of scope

A low-traffic write path. Note that a new event must reach the search index, then leave the admin tooling out.

Dynamic pricing

Out of scope

Changes the price on a ticket row, not the booking mechanics. Store price per ticket so it could be added later.

Non-functional requirements

RequirementWhat it forces

No seat is ever sold twice: consistency for booking

One place decides who gets a seat, and it must decide atomically: a set-if-absent on a seat key, or a conditional update on the ticket row. The final transition to sold happens inside a transaction in the main database, so a lost hold still ends with one winner.

Availability for browsing and search

Event, venue and search reads come from caches and a separate search index, so they keep answering when the booking path is saturated or the payment provider is slow. Stale by a little is acceptable here; down is not.

About 10 million users on one popular event

The event page for that one event must be served from cache and from stateless servers behind a load balancer, and the booking path needs a gate that admits buyers in batches, because millions of hold attempts on one event's seats would overwhelm any single decision point.

Search answers in under 500 ms

No table scan on the request path. Search runs against an index built for text, and the most common queries are cached, since the same artist name is typed again and again while an on-sale runs.

Reads outnumber bookings about 100 to 1

Split the read side (event and search services) from the write side (booking) so each scales on its own, put the caching effort on the read side, and spend the correctness effort on the much smaller write side.

Estimates

QuantityWorkingResultWhat it sizes

Share of requests that are reads

With 100 reads for each write, 100 ÷ 101 ≈ 99% of requests are reads

About 99% of requests are reads

The event cache: if it answers the reads, the events database sees roughly one request in a hundred, and the booking path is a small fraction of the traffic.

Booking requests the ratio implies at the on-sale

10 million viewers ÷ 100 reads per write ≈ 100,000 booking requests over the on-sale, as a rough order of magnitude

On the order of 100,000 booking requests against 10 million page views

The booking path: far smaller than the read path, but all of it lands on one event's seats, which is why it needs a gate rather than more servers.

Seconds in a 10-minute hold

10 minutes × 60 seconds a minute = 600 seconds

600 seconds

The EX argument on the Redis SET that holds a seat, or the offset added to now for a reserved ticket's expiry timestamp.

How long a cleanup job that runs once a minute can leave a free seat shown as taken

A hold that lapses just after one run stays marked reserved until the next: up to 60 seconds, which is 60 ÷ 600 = 10% of the hold itself

Up to 60 seconds, a tenth of the hold

The cost of freeing seats with a scheduled job instead of reading the expiry on the way out, and the reason a lapsed hold should be treated as free the moment it lapses.

Batches of admitted buyers inside booking at once

Each admitted buyer gets up to 10 minutes; admitting a batch each minute means 10 ÷ 1 = ten batches overlap

About ten batches active at any moment

The admitted set in Redis, and the batch size: the number of buyers the booking path can serve at once, divided by ten.

Core entities

EntityWhat it holds

Event

One performance at one venue on one date, with the tickets that belong to it.

Venue

The place, its capacity and the seat map the event page draws.

Performer

The artist or team; its name is one of the things people type into search.

Ticket

One seat at one event. Its status is the thing two buyers race over.

Booking

One purchase attempt by one user for a set of tickets, from in progress to confirmed.

Seat hold (Redis key)

A key per ticket id, written with a set-if-absent, that expires on its own after the hold time.

The API

EndpointNotes

GET /events/{eventId} → event, venue, performer, tickets[]

Event, venue and performer are served from a cache with a long lifetime, because they rarely change. The tickets list carries each seat's status and is cached for a short time or, for ordinary events, kept current over a server-sent event stream. For the biggest on-sales, this call is answered from cache for everyone and the live map is dropped.

GET /events/search?keyword&start&end&page → events[]

Goes to the search service, which queries a search index that tolerates typos in the name and performer and filters on the date range. Common queries are cached. Results may lag the main database by the replication delay, which is acceptable for discovery.

POST /bookings/{eventId} { ticketIds[], paymentDetails } → { bookingId }

The user comes from the session, not the body. The booking service tries to hold each ticket id with a set-if-absent and a time limit; if any seat is already held it releases the ones it took and returns 409 Conflict. It then writes a booking in progress, creates the payment with the provider, and returns the booking id. Confirmation arrives later through the provider's webhook. During a gated on-sale, the request must also carry a valid admission token, or it is refused.

The high-level design

ClientAPI gatewayEventsPostgresBooking

Step 1 of 4

Browse and book through one gateway

Start with the two jobs the requirements name. An API gateway in front handles sessions and rate limits and routes to an event service for GET /events/{eventId} and a booking service for POST /bookings/{eventId}. Both read and write one relational database that holds events, venues, performers, tickets and bookings; a ticket row carries the seat's status. The booking service runs its writes in transactions, so a sale changes the ticket and creates the booking together or not at all. This is enough to sell a ticket to one buyer at a time. It has no answer yet for two buyers who want the same seat while one of them is still typing a card number.

positionadmittedholdpaymentwebhookCDCClientAPI gatewayEvent serviceSearch serviceWaiting queueEvent cachePostgresElasticsearchRedis sorted setBooking serviceRedis seat holdsStripe
The whole design

What breaks first

The deep dives

Holding seats during checkout. Two buyers click the same seat in the same second and both start paying. What stops the seat from being sold twice, what does each buyer see, and what happens if a hold runs out while a payment is still being processed?

A concept that helps here: Distributed locks and leasesA concept that helps here: Optimistic and pessimistic lockingA concept that helps here: Idempotency keys

A huge on-sale. Ten million people open one event the second sales start. What does each part of the design see, which part fails first, and how do you let buyers through without the booking path collapsing?

A concept that helps here: Virtual waiting roomsA concept that helps here: Backpressure and load sheddingA concept that helps here: Sorted sets and leaderboards

Fast search. Someone types an artist's name with a typo and expects results in under half a second. Where does the query run, how does the index learn about a new event, and what does that choice cost?

A concept that helps here: Inverted indexesA concept that helps here: Change data captureA concept that helps here: Database indexes

Concepts this guide uses

Sources

  1. Redis documentation: SET
  2. Redis documentation: ZRANK
  3. PostgreSQL documentation: Explicit Locking
  4. PostgreSQL documentation: Full text search, tables and indexes
  5. Elasticsearch reference 8.19: Fuzzy query
  6. Debezium documentation: Debezium connector for PostgreSQL
  7. MDN: Server-sent events
  8. MDN: Using server-sent events
  9. Stripe documentation: Receive Stripe events in your webhook endpoint
  10. Ticketmaster help center: What is the queue and how do I join?
  11. NBC News: Ticketmaster says Verified Fan registration doesn't measure fandom
  12. System Design School: Ticketmaster (ticket booking) system design
  13. DEV Community: Design Ticketmaster, the system design interview walkthrough
Sign in to report a mistake