Scope
Functional
- Browse movies/events, cities, venues, shows; view a live seat map.
- Select seats → temporary hold (e.g. 8 minutes) → pay → confirmed booking with ticket.
- Cancellation per policy.
Non-functional
- Never double-book a seat. Holds expire reliably.
- Seat map freshness within a few seconds.
- Survive "first day first show" spikes: 1M users trying to book within minutes.
Size
- 1M bookings/day on average; peaks of 50k booking attempts/s for blockbuster openings.
- Seats per show ~300; shows per day ~100k → 30M seat-show rows per day: manageable, partitioned by show.
Data model
| Table | Key | Notes |
|---|---|---|
| shows | show_id |
movie, screen, start time, pricing |
| show_seats | (show_id, seat_id) |
status: AVAILABLE / HELD / BOOKED, hold_id, hold_expires_at, version |
| holds | hold_id |
user, show, seats, expires_at, status |
| bookings | booking_id |
user, show, seats, payment_id, status |
Partition show_seats by show_id: a booking touches one show, so it's a single-partition transaction.
The architecture
The 30-second summary
"Seat state lives in a relational store partitioned by show. Holding is a single conditional UPDATE in a transaction, all-or-nothing on the seat set, with expiry; a unique constraint on bookings guarantees no double sale. Payment runs as a saga keyed by the hold ID, with auto-refund if the hold lapses. Hot releases go through a virtual waiting room, and the seat map is a cached, slightly stale view."
Follow-up questions the interviewer may ask
- How do you show a live seat map to thousands of people?
- What if a user holds seats and never pays?
- How do you handle a blockbuster opening with 1M users at once?
- What if payment succeeds after the hold expired?
Model answers to each of these are in the book.