← Lessons

quiz vs the machine

Gold1470

System Design

The Airbnb Search and Booking

Search must be fast and stale tolerant while booking must be strictly consistent.

5 min read · core · beat Gold to climb

Two systems with opposite needs

Airbnb search browses millions of listings and tolerates slightly stale results. Booking touches one listing and must never double book. The same product needs both relaxed and strict consistency.

Search side

Search runs against a read optimized index of listings with filters for location, dates, and price. This index is refreshed from the source of truth and can lag a little without harm.

  • Search index answers fast geo and availability filters
  • It is eventually consistent with the booking database
  • Showing a listing that just sold is acceptable until checkout

Booking side

Booking is a transaction. When a guest confirms, the system locks the date range for that listing and commits atomically. If two guests race for the same dates, only one transaction wins.

The design splits the workload so search stays fast and approximate while booking stays strict and transactional.

Key idea

Serve search from an eventually consistent index for speed, but settle bookings with a strict transaction that locks the date range so a listing is never double booked.

Check yourself

Answer to earn rating on the learn ladder.

1. Why can the search index be eventually consistent?

2. How does booking prevent double booking the same dates?