Case study: design a ticketing system
Interview question: design ticket sales for a concert company. Fans pick seats on a map, hold them while they pay, and get tickets. For the year's biggest show, 2 million fans arrive in the first minute for 60,000 seats. How do you sell every seat exactly once, and make it feel fair?
In this lesson you'll learn to
- Turn the ticketing question into requirements and numbers, and see that contention on a few hot rows, not storage, is the problem.
- Hold seats atomically with conditional updates and an expiry built into the condition, and keep the seat map as a cached read model.
- Turn a hold into a sale safely, pinning the hold during payment and using idempotency keys, without ever selling a seat twice.
- Protect the booking system with a virtual waiting room that admits fans at a steady rate, and make the sale fair to people, not bots.
Create a free account to open this lesson
It's free. You'll get every free lesson, quizzes that save your progress, daily flashcards and streaks.