RETURN TO SYSTEM DESIGN VAULT (55)BLUEPRINT #28 // Medium
#28MediumFinTech & Transactional APIs
Design a Hotel Booking System: Room Availability, Reservation, Booking
ASKED IN INTERVIEWS AT:AmazonSquareBooking.com
EXECUTIVE SUMMARY & PROBLEM STATEMENT
Architect a hotel reservation platform that guarantees zero overbooking during concurrent checkout rushes through distributed locking, idempotent transactions, and 15-minute hold reservations.
SCALE ESTIMATION & TRAFFIC ENVELOPE
DAILY ACTIVE USERS / TPS50 Million daily searches, 500K bookings/day
READ / WRITE TRAFFIC RATIO100:1 search to booking ratio
5-YEAR STORAGE CAPACITYRelational DB with strong consistency for inventory
FUNCTIONAL REQUIREMENTS
- [1]Search hotel rooms by date range and location
- [2]Hold room inventory for 15 minutes during checkout
- [3]Complete payment and confirm booking
NON-FUNCTIONAL REQUIREMENTS
- •Absolute zero overbooking under high concurrency
- •Fast room search results (< 100ms)
- •Idempotent payment processing
CORE ARCHITECTURAL COMPONENTS
Search Service (Elasticsearch)
Inventory Reservation Manager (PostgreSQL with Row-Level Locking)
Redis Temporary Lock Store
Payment Saga Coordinator
DATA SCHEMA & PERSISTENCE
RoomInventory (hotel_id, room_type_id, date, total_rooms, reserved_rooms), Bookings (booking_id, user_id, room_id, status, expires_at)
DISTRIBUTED TRADE-OFFS & FAILURE MODES
- ⟡Optimistic locking with version checks fails fast during checkout races, whereas pessimistic locks hold database rows.