Commerce & payments · Intermediate
Hotel & home-stay booking
Geo and date search over a stale-tolerant index, with reservations that lock per-night inventory.
Every part, and why it is there
Guests
Guests search far more than they book, often a hundred searches per reservation. The read path and the booking path have very different needs.
Hosts & hotel systems
Hosts edit listings, prices and calendars, and hotels sync from their property-management software. These updates must reach search without slowing it down.
Load balancer
Spreads traffic across the three services by path. Each service scales on its own because search, booking and listing edits peak at different times.
Search service
Answers “homes near Lisbon for 12–15 June for 2 guests”: a geo filter, a date-availability filter and ranking. It reads only from its index and cache.
Listings index (geo + dates)
A search engine copy of listings with location, amenities and open dates. It is allowed to be a few seconds behind, because the reservation step re-checks.
Search & price cache
Popular searches (same city, same weekend) repeat constantly. Caching results for a minute or two cuts index load sharply.
Reservation service
Books the stay. In one transaction it locks the requested nights for that room, checks every night is still free, and marks them taken.
Inventory & reservations
One row per room per night. Booking becomes a short row-locked update, and a constraint stops two reservations ever covering the same night.
Payment provider
The card is authorised when the stay is booked and captured later. If authorisation fails, the transaction rolls back and the nights are free again.
Listing service
Where hosts edit their listing. It owns the listing record and announces every change instead of updating the search index itself.
Listings DB
The source of truth for listing details and photos metadata. Search never queries it directly.
Listing changes
A change feed (change data capture) from the listings DB. Anything that needs listing data, such as the search indexer, subscribes here.
Search indexer
Rebuilds the search document for each changed listing and writes it to the index, usually within seconds.
Asked in interviews at
- rippling
- airbnb
- revolut
- meta
- zoom
Learn more
- Design a Hotel Booking System Like a Senior Engineer (Hayk Simonyan)
- Airbnb System Design | Booking.com System Design | System Design Interview Question (codeKarle)
- Elasticsearch Deep Dive w/ a Ex-Meta Senior Manager for System Design Interviews (Hello Interview)
- Elasticsearch deep dive (Hello Interview)
- Hotel reservation system (ByteByteGo)
- Explicit locking (PostgreSQL)