KatInterview

Design a Real-Time Event Ticketing and Seat Reservation Platform

System DesignModel answer
MediumModel answerSystem Designsystem-designconcurrencydistributed-systems

Last updated

Design a scalable event ticketing backend that supports high-throughput browsing and guarantees strong consistency during high-contention seat reservation and payment flows.

Architect the backend infrastructure for a high-volume event ticketing service where clients can browse active venues, select specific seats on a interactive seating layout, and complete purchases.

Your solution must gracefully manage major traffic spikes when highly anticipated tickets drop, ensuring strict isolation so that no individual seat is ever double-booked across competing transactions.

Core Functional Requirements

  1. Catalog & Availability: Users can search events and retrieve live seat availability for specific event maps.
  2. Temporary Holds: A user can lock one or more seats for a configurable time window (e.g., 10 minutes) to proceed through checkout.
  3. Checkout & Purchase: Users can supply payment information to finalize holds into confirmed orders.
  4. Automatic Hold Expiration: If the checkout timer elapses prior to payment authorization, reserved seats must immediately return to the open pool.

Core Non-Functional Requirements

  1. Strict Data Consistency: Absolute linearizability for seat allocations—zero overbooking or concurrent assignment of identical seats.
  2. Massive Scalability: Support traffic surges up to 100,000 requests per second (RPS) during major drop times without degrading write safety.
  3. High Read Availability: Viewing event listings and seat maps must remain fast and available, even during peak load.
  4. Auditability & Traceability: Retain an immutable audit trail of every seat state transition for accounting, fraud detection, and operational debugging.

Expected Deliverables

  1. High-Level System Architecture: Diagram narrative and service layout separating read-heavy catalog paths from write-heavy transactional paths.
  2. API Specification: Endpoint contracts for seat locking, checkout, and payment processing.
  3. Data Model Strategy: Storage technology selection (SQL vs. NoSQL) with exact table/document schemas and primary/secondary indexing choices.
  4. Concurrency & Reservation Mechanics: Technical depth on preventing race conditions, handling state transitions, and managing queue admission during high-contention scenarios.

Hints

Hint 1

Differentiate the read path (seat availability maps) from the write path (locking specific seat IDs). Seat maps can accept second-scale staleness, while seat allocation requires strict linearizability.

Hint 2

Consider how an atomic conditional SQL query (`UPDATE ... WHERE status = 'AVAILABLE'`) can act as the ultimate single source of truth, avoiding split-brain scenarios common in distributed locks.

Hint 3

Incorporate a virtual waiting room or traffic shaper upstream to convert massive incoming traffic spikes into a controlled, manageable stream of requests aligned with database write capacity.