System Design: Extensible EventTicketSystem
Context
Design a ticketing platform that sells tickets for concerts, movies, and sports. The system must support both reserved seating and general admission. It should be easy to extend with new ticket types and pricing policies without modifying core code.
Assume web/mobile clients, high read/write concurrency during popular on-sales, and integration with a payment provider.
Requirements
-
Core features
-
Create/list events and venue inventory.
-
Show inventory by event (seats, sections, GA counts).
-
Hold/reserve seats with TTL and automatic expiry.
-
Purchase tickets with idempotency guarantees.
-
Refunds (full/partial) with proper accounting.
-
Extensibility and pricing
-
New ticket types can be added via a factory/registration mechanism without code changes to core services.
-
Pluggable pricing strategies per ticket type (dynamic pricing, fees, discounts).
-
Concurrency and reliability
-
Concurrency control for seat contention (avoid oversell; high throughput during on-sale).
-
Transactions, rollback behavior, and idempotency for purchases.
-
Persistence/schema design for events, inventory, holds, orders, payments, refunds.
-
Error handling strategy and API error semantics.
-
Interfaces and APIs
-
Propose core REST and/or gRPC APIs.
-
Engineering considerations
-
Complexity considerations and scalability.
-
Test strategy (unit, integration, concurrency tests).
-
Evolution path for new ticket types and pricing policies.