AlgoViz

Design Ticketmaster

hard 55 min

Sell 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

10M×5×1086,400≈5,800/s×3≈17,400/s\frac{10\text{M}\times 5\times 10}{86{,}400} \approx 5{,}800/s \qquad \times 3 \approx 17{,}400/s
500M calls a day. Ordinary scaling and caches.

The sale

14M×100900 s≈1.56M/s×20%≈310,000/s at the origin\frac{14\text{M}\times 100}{900\,s} \approx 1.56\text{M}/s \qquad \times 20\% \approx 310{,}000/s\ \text{at the origin}
An average over the quarter hour, 90 times the normal peak. Sized at 3x, the first minute is 4.7M a second.

The door

5,000÷3 min≈1,667/min1,667×3÷60≈83 holds/s5{,}000 \div 3\,\text{min} \approx 1{,}667/\text{min} \qquad 1{,}667\times 3 \div 60 \approx 83\ \text{holds}/s
5,000 people inside for three minutes each, three tries at a seat each.

All the numbers

QuantityWorkingResult
People against seats14M ÷ 80,000 and ÷ 50,000175 to 280 for each seat
Orders at full speed5,000 × 20 an hour100,000 an hour, 28 a second
50,000 seats, 2 in an order25,000 ÷ 1,66715 minutes, 25 if 60% buy
Waiting page asks each 30 s14M ÷ 30467,000/s, all at the CDN
The same with open connections14M ÷ 100,000140 servers, 47 MB/s of updates
Places in Redis14M × 100 B1.4 GB
Hold state for 100 such sales100 × 80,000 × 100 B800 MB
Seat rows on sale10,000 events × 1,000 × 200 B2 GB
Orders a year250M × 2 KB500 GB
Tickets a year500M × 500 B250 GB
Orders and tickets, five years750 GB × 53.75 TB, about 10 TB with indexes, people and spare
Events500,000 × 10 KB5 GB a year
Accounts100M × 2 KB200 GB
Search index500,000 × 5 KB, four copies10 GB
Pictures and maps10,000 × 100 MB + 500,000 × 5 MB3.5 TB

So what?

The decision each number makes

NumberDecisionWould change if
17,400 reads/s, few different pagesCDN and Redis for eventsUnder 1,000/s one database
1.56M/s for minutesWaiting room at the edge, capacity prepared beforeA sale of thousands
83 holds a secondSeat rows in the database, no lock serviceThousands of holds a second in one event
28 orders a secondOne checkout database is plentyHundreds of giant sales at once
2 GB of seats on saleFits in memory; shard by event for isolation, not sizeNever by size
3 minutes a visit, 10 minutes a holdAdmit by people inside, not by a fixed rateVisits had a fixed length