Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 610 Bytes

README.md

File metadata and controls

15 lines (11 loc) · 610 Bytes

Cinema ticket booking system

Starter code for the gradual explanation on how to create a ticket booking system to solve for the double booking system and provide a good UX for clients when booking a ticket and avoid conflicts in a high contention enviroment.

The Problem

Two users click "Book" on seat A1 at the same instant. Only one should win.

User A ──► read seat A1 → "free" ──► write booking ──► success
User B ──► read seat A1 → "free" ──► write booking ──► ???

Without any protection, both succeed. Now two people show up for the same seat.