Design an online ticketing system (similar to Ticketmaster) that allows users to browse events, select seats, and place a temporary 5-minute hold on seats while they complete the purchase.
The system should:
-
Allow users to search for events, view seating charts, and select specific seats.
-
Allow a user to place a 5-minute hold on selected seats so they are not sold to others during that time.
-
Automatically release held seats if the user does not complete payment within 5 minutes.
-
Ensure that no two users can successfully purchase the same seat.
-
Scale to handle very high traffic during popular events (e.g., tens of thousands of concurrent users for a big concert).
Describe:
-
The main use cases and external APIs.
-
The high-level architecture and key components.
-
The data model for events, seats, orders, and seat holds.
-
How you will implement the 5-minute hold and its expiration.
-
How you will handle high concurrency and prevent overselling seats.
-
Consistency and availability trade-offs, and how you would scale the system.
Assume this is an internet-scale service deployed across multiple servers and data centers.