15 Design Airbnb

 

This chapter covers

  • Designing a reservation system
  • Designing systems for operations staff to manage items and reservations
  • Scoping a complex system

The question is to design a service for landlords to rent rooms for short-term stays to travelers. This may be both a coding and system design question. A coding discussion will be in the form of coding and object-oriented programming (OOP) solution of multiple classes. In this chapter, we assume this question can be applied to reservation systems in general, such as

  • Movie tickets
  • Air tickets
  • Parking lots
  • Taxis or ridesharing, though this has different non-functional requirements and different system design.

15.1 Requirements

Before we discuss requirements, we can discuss the kind of system that we are designing. Airbnb is:

  1. A reservation app, so there is a type of user who makes reservations on finite items. Airbnb calls them “guests.” There is also a type of user who creates listings of these items. Airbnb calls them “hosts.”
  2. A marketplace app. It matches people who sell products and services to people who buy them. Airbnb matches hosts and guests.
  3. It also handles payments and collects commissions. This means there are internal users who do customer support and operations (commonly abbreviated as “ops”), to mediate disputes and monitor and react to fraud. This distinguishes Airbnb from simpler apps like Craigslist. The majority of employees in companies like Airbnb are customer support and operations.

15.2 Design decisions

 

15.2.1 Replication

 
 
 
 

15.2.2 Data models for room availability

 
 
 

15.2.3 Handling overlapping bookings

 
 
 

15.2.4 Randomize search results

 
 
 

15.2.5 Lock rooms during booking flow

 
 

15.3 High-level architecture

 
 
 
 

15.4 Functional partitioning

 
 
 

15.5 Create or update a listing

 
 

15.6 Approval service

 
 
 

15.7 Booking service

 
 
 
 

15.8 Availability service

 
 
 
 

15.9 Logging, monitoring, and alerting

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest