"Case Study: Ticket Booking"
A ticket site sells a fixed number of seats, and many people want the same ones at the same second. The central trade-off is correctness against speed: one seat must never be sold twice, yet the site must not freeze when a million people arrive. The design rests on made-up assumptions. After reading you can stop double booking with one atomic database update (one step that cannot be split; here in PostgreSQL), explain holds, a waiting room and payment retries, and say what happens when payment arrives after a hold ended.
Topics in this section
- Requirements and scope
- Numbers
- API and data
- The first design
- Never selling a seat twice
- Holds, waiting rooms and payment
- Failures and scaling