Design a High-Spike Ticket Purchasing Platform
Context
A popular concert sale can trigger sudden spikes of up to millions of requests per second (RPS). You need to design a backend that:
-
Prevents overselling.
-
Ensures fairness among users.
-
Remains resilient and observable under extreme load.
Assume: mobile-heavy traffic, a global audience, and both reserved seating and general admission are possible. Payments are processed through third-party gateways.
Requirements
-
Admission control at the edge (e.g., rate limiting, token bucket/leaky bucket).
-
Virtual waiting room and queueing model to smooth spikes and enforce fairness.
-
Anti-bot defenses.
-
Idempotent order creation and deduplication.
-
Inventory management: reservation-with-TTL vs immediate deduction.
-
Avoiding hot-spot keys under skewed access patterns.
-
Data model and partitioning strategy.
-
Caching strategy.
-
Consistency strategy (optimistic/pessimistic locking, outbox/inbox, retries).
-
Delivery semantics: exactly-once vs at-least-once.
-
Capacity estimates (QPS, p99 latency goals).
-
Failure handling (timeouts, circuit breakers, dead letters).
-
Monitoring and alerting.