Skip to content

Case study: Hotel booking

Design a hotel reservation system with fast cached availability search, atomic room inventory holds, and idempotent checkout without overselling.

35 min9 steps

By the end you can
  • Estimate room-night inventory storage, browse-to-book traffic ratio, and peak checkout rate
  • Model nightly room availability and reservation state transitions to prevent double-booking and deadlocks
  • Guarantee zero overselling under flash-sale concurrency using atomic conditional decrements and idempotency keys
  • Predict how availability caching, hold expiry reapers, and database failover behave under failure

Separate the read flood from the transactional core

Browse

  • Availability/rates for [checkIn, checkOut); p99 <150 ms

Reserve

  • Timed holds, payments, confirmation/cancellation; p99 <500 ms

Safety

  • Strict room-night transactions; no accidental oversell/duplicate charge; browse may lag seconds

Which clarifying question has the biggest impact on the inventory data model?

Answer this step to continue.