Design a Hotel Booking Service - System Design Mock Interview (with eBay EM)
Designing a Hotel Booking Service
In this transcript, the speaker discusses the functional and non-functional requirements for designing a hotel booking service. They also estimate the amount of data that would need to be stored and discuss some potential challenges.
Functional Requirements
- The system should allow users to view hotel pages, add hotels, delete hotels, and update hotels.
- The system should allow users to search for hotels and book rooms.
- The system should prevent double bookings by assigning room numbers during check-in.
Non-Functional Requirements
- The system should be highly scalable and fast, with search results loading in under 150 milliseconds.
- The system should have proper identity access management systems in place for security purposes.
- The system should have DDoS protection and rate limiting to prevent attacks.
Backend Estimation
- There could potentially be one million hotels with 100 rooms each, resulting in around 100 million rooms total.
- If reserving five million room types per day over ten years, there would be around 180 billion rooms total.
Data Storage and Model
In this section, the speaker discusses the data storage and model required for the hotel reservation system.
Inventory and Room Types
- The system would require an inventory or storage to keep track of available rooms.
- Hotels will have a lot of images that need to be stored, which cannot be done in a relational database. S3 can be used for image storage.
- For each room type on a given date, there should be information on how many rooms are available and how many are reserved.
Reservation Table
- A reservation table is needed to store information about reservations made by users.
- Information such as the hotel ID, start date, end date, and room type ID should be included in the reservation table.
System Design
In this section, the speaker discusses the system design for the hotel reservation system.
Services and Load Balancer
- The system will have multiple services such as an inventory service and a view hotel service.
- Each service will have its own load balancer to handle incoming requests.
Experience Layer
- An experience layer will be created to provide a consistent user interface across different platforms such as mobile web or desktop web.
Payment Processing
In this section, the speaker briefly mentions payment processing for hotel reservations.
Payment Processing
- No bullet points with timestamps were provided in this section.
Reservation and Inventory Services
In this section, the speaker discusses the need for a reservation database that talks to the inventory to ensure that both are in sync with each other. The speaker also explains different approaches to creating a reservation service and how it can be integrated with an inventory service.
Microservice-based Architecture
- A microservice-based architecture can be used where the reservation service has a dedicated database.
- If transactions are involved, having them on the same server would make life easier.
- However, bigger companies usually have different teams managing viewing and reservation parts, so separate databases and storages are preferred.
Reservation Service States
- Reservation service will have states such as pending, complete, or cancel.
- Payment failure will trigger an event queue that listens to payment failed topics.
- As soon as events happen, appropriate service calls will be made to update the state of reservations and inventory.
User Experience Layer
In this section, the speaker explains how users interact with different services when booking a hotel.
Booking Process
- When a user books a hotel, they interact with different services through UI screen experience layer.
- The user's request is sent to both reservation and inventory services.
- The available count is checked against requested count in the inventory table before updating it.
[CUTOFF_LIMIT]
Turn any video into a summary like this
YouTube links, meetings, lectures. With transcripts, search, and chat.