37. Reservation with a TTL, and a Unique Constraint
Scarce inventory — a seat, a room, the last unit — with far more buyers than units. Holding a database row for the minutes someone takes to pay does not scale, and checking availability before writing is a race that sells the same seat twice.
Product & backendMedium