Design Ticketmaster
hard 55 minSell numbered seats to far more people than there are seats.
Video lesson · Chapter 1 of 6
One hold covers two seats
Theory
Read or listen first. About 1 min.
What it is
A ticket seller lets people find an event, pick numbered seats on a map, pay, and receive tickets that open the door. A service like Ticketmaster, SeatGeek or AXS does this.
Each seat exists once and cannot be restocked. On most days that is easy. When a famous artist sells out a stadium, millions want the same thousands of seats in the same minute, and the design is about that minute.
Why it exists
Selling one seat twice puts two people in front of one chair. Failing under the crowd loses a sale that will not come back and angers fans. Both must be prevented at once.
The same shape appears in hotel rooms, flights, restaurant tables and clinic appointments: hold something unique for a short time, then confirm or give it back.
A short history
1976
Ticketmaster is founded in Phoenix, Arizona, and licenses ticketing programs and hardware.
2016
The BOTS Act makes it illegal in the United States to get around ticket sellers' controls with software.
2022
A presale for a stadium tour draws a reported 14 million visitors against 1.5 million prepared for, and the site fails within an hour.
Words to know
- Hold
- A seat kept for one shopper for a short time.
- Oversell
- Selling the same seat to two people.
- Waiting room
- A page where people wait outside the shop and are let in at a steady pace.
- Admission rate
- How many people a minute may enter.
- Authorise and capture
- Reserve money on a card first, take it later.
- Idempotency key
- A value that makes a repeated request have the effect of one.
- Compensation
- A step that undoes an earlier one, such as a refund.
- Outbox
- Messages saved in the same transaction as the change they announce.
Solve it like an interview
New to it? Start with Approach. Revising? Go straight to the mock.
- 1ApproachWhat this question tests, where it gets hard, and how to spend the time.
- 2ScopeAsk what changes the design, then commit to a short list.
- 3NumbersWork out a number when the answer changes what you build.
- 4API and dataThe contract first, then the data that serves it.
- 5DesignStart with the smallest system that works. Change it only when something breaks.
- 6Deep divesCompare the options before you open them, then say which you would pick.
- 7Explain your choicesAnswer first. Then compare your reasoning.
- 8By levelThe same question is judged differently for mid, senior and staff.
- 9MockAnswer against the clock, then score yourself.
How it works
Step through the idea, or press Play.
Wait. A shuffled line, and a steady door
Understand it
A ribbon is a promise with an end. A rosette is for ever.
Scope
What are we building?
Search for events, look at a seat map, hold seats, pay, get tickets. The interesting case is one sale with 14 million people and 50,000 seats. General crowd control is in flash sale, and stock that is not numbered in inventory.
One seat, one owner
Never sold twice, whatever fails.
A fair door
Fast lines and scripts win nothing.
Safe money
No charge without a seat, no double charge.
Similar applications
| Service | What is unique |
|---|---|
| SeatGeek, AXS | Seats at events |
| StubHub | Resold tickets |
| Eventbrite | Events by small organisers |
| Booking.com | Hotel rooms by night |
| OpenTable | Tables by time |
| Airline seats | Seats on a flight |
| Flash sales | A small stock at a fixed minute |
The hard part
Two problems that look like one
The crowd is a load problem: 1.5 million requests a second for a quarter of an hour. The seat is a contention problem: two people, one row. Mixing them leads to exotic locks. Once the door lets in 1,667 people a minute, only about 83 holds a second reach the seats, and an ordinary transaction is enough.
The finished system
Where the design ends up
The whole system
Where each idea lives
| Idea | Read |
|---|---|
| Two writers, one row | Concurrency control, isolation levels |
| Many misses at once | Thundering herd |
| Retries and keys | Idempotency |
| Steps that can be undone | Saga |
| Pages near the fans | CDN, cache-aside |
| Search | Full-text search, or the Yelp problem for places nearby |
| Limits for each client | API rate limiter |
| The interview, tab by tab | Approach, Scope, Numbers, API, Design, Deep dives, Choices, Levels, Mock |
Summary
The whole topic in one minute.
The crowd and the seat are two problems. A waiting room served from the edge lets in only as many people as the shop can serve. Inside, seat holds are so few a second that one database decides them safely with a short transaction.
Buying moves a seat from held to paying to sold. Money is reserved before the sale is written and taken after. A unique rule on tickets is the last guard, and everything slow happens after the commit.
- Separate the crowd from the seat.
- Shuffle the lobby, then call places with one public number.
- A hold is a state and an end time in the seat's own row.
- Authorise, sell in one transaction, then capture.
- Only an answer from the provider frees a seat that is being paid for.