Design Ticketmaster
hard 55 minSell numbered seats to far more people than there are seats.
Numbers that decide
Work out a number when the answer changes what you build.
Capacity
Scale estimates
Assumptions: 500,000 events and 500M tickets a year, so 1,000 tickets an event on average (200 to 80,000). On a normal day 10M people open 5 pages of 10 calls. A giant sale draws 14M people who make 100 requests each in 15 minutes, of which the CDN answers 80%.
A normal day
The sale
The door
All the numbers
| Quantity | Working | Result |
|---|---|---|
| People against seats | 14M ÷ 80,000 and ÷ 50,000 | 175 to 280 for each seat |
| Orders at full speed | 5,000 × 20 an hour | 100,000 an hour, 28 a second |
| 50,000 seats, 2 in an order | 25,000 ÷ 1,667 | 15 minutes, 25 if 60% buy |
| Waiting page asks each 30 s | 14M ÷ 30 | 467,000/s, all at the CDN |
| The same with open connections | 14M ÷ 100,000 | 140 servers, 47 MB/s of updates |
| Places in Redis | 14M × 100 B | 1.4 GB |
| Hold state for 100 such sales | 100 × 80,000 × 100 B | 800 MB |
| Seat rows on sale | 10,000 events × 1,000 × 200 B | 2 GB |
| Orders a year | 250M × 2 KB | 500 GB |
| Tickets a year | 500M × 500 B | 250 GB |
| Orders and tickets, five years | 750 GB × 5 | 3.75 TB, about 10 TB with indexes, people and spare |
| Events | 500,000 × 10 KB | 5 GB a year |
| Accounts | 100M × 2 KB | 200 GB |
| Search index | 500,000 × 5 KB, four copies | 10 GB |
| Pictures and maps | 10,000 × 100 MB + 500,000 × 5 MB | 3.5 TB |
So what?
The decision each number makes
| Number | Decision | Would change if |
|---|---|---|
| 17,400 reads/s, few different pages | CDN and Redis for events | Under 1,000/s one database |
| 1.56M/s for minutes | Waiting room at the edge, capacity prepared before | A sale of thousands |
| 83 holds a second | Seat rows in the database, no lock service | Thousands of holds a second in one event |
| 28 orders a second | One checkout database is plenty | Hundreds of giant sales at once |
| 2 GB of seats on sale | Fits in memory; shard by event for isolation, not size | Never by size |
| 3 minutes a visit, 10 minutes a hold | Admit by people inside, not by a fixed rate | Visits had a fixed length |