Hotel Booking Sites System Design Explained | Airbnb | Agoda | Make My Trip |

Поділитися
Вставка
  • Опубліковано 30 вер 2024
  • In this video about Hotel Booking System Design, we will look at the complexities behind user-friendly interfaces and sophisticated backend operations that power renowned platforms like Airbnb, Agoda, and Make My Trip.
    Check out FREE MASTERCLASSES by Industry-Leading Experts: www.scaler.com...
    Discover the technology driving these systems, explore the design principles enhancing user experiences, and gain valuable insights into the behind-the-scenes mechanisms that make these platforms go-to choices for travelers worldwide.
    What is system design?
    System design is the process of defining and developing the architecture, components, modules, interfaces, and data for a system to meet specified requirements. It involves analysing user needs and constraints to create a plan for the construction, deployment, and maintenance of the system.
    What is high-level design?
    High-level design refers to the architectural and conceptual overview of a system or software solution. It focuses on identifying major components, their interactions, and the overall structure of the system, providing a top-level understanding of how the solution will be implemented to meet the desired requirements.
    What is low-level design?
    Low-level design refers to the detailed design and implementation of individual components or modules within a system or software solution. It involves specifying the data structures, algorithms, interfaces, and code-level details necessary to realise the high-level design and achieve the desired functionality.
    #systemdesign #softwareengineering #scaler
    ______________________________________________________________________________
    About SCALER:
    A transformative tech school, creating talent with impeccable skills. Upskill and Create Impact.
    Learn more about Scaler: bit.ly/41jAQkp
    📌 Follow us on Social and be a part of an amazing tech community📌
    👉 Meet like-minded coder folks on Discord - / discord
    👉 Tweets you cannot afford to miss out on - / scaler_official
    👉 Check out student success stories, expert opinions, and live classes on Linkedin - / scalerofficial
    👉 Explore value-packed reels, carousels and get access to exclusive updates on Instagram - / scaler_official
    📢 Be a part of our one of a kind telegram community: t.me/Scalercom...
    🔔 Hit that bell icon to get notified of all our new videos 🔔
    If you liked this video, please don't forget to like and comment. Never miss out on our exclusive videos to help boost your coding career! Subscribe to Scaler now!
    www.youtube.co...

КОМЕНТАРІ • 33

  • @SCALER
    @SCALER  10 місяців тому +2

    Learn more about Scaler: bit.ly/41jAQkp

  • @prakharjain-r6t
    @prakharjain-r6t Місяць тому +1

    Super great explanation. super bad drawing.

  • @yashnasery8501
    @yashnasery8501 3 дні тому

    The inventory table for me needs a little bit of explanation. In the booking flow described around 01:06:50, it is said that we check if rooms are available in inventory for all the dates between check-in and check-out. There are a few things left unexplained here (Apologies if I missed it somehow and it was explained.)
    1) The inventory table has inventory on dates. For example (Correct me if this example is wrong)
    hotel_id = 10, room_type_id = 1, date = 16th May, available_rooms = 4, total_rooms = 10
    hotel_id = 10, room_type_id = 1, date = 17th May, available_rooms = 4, total_rooms = 10
    hotel_id = 10, room_type_id = 1, date = 18th May, available_rooms = 4, total_rooms = 10
    Questions:
    1) who creates these entries for particular dates? ( I know who decrements them - the person trying to do a booking )
    2) what if I want to book hotel_id = 10 and room_type_id = 1 for dates 17th May - 20th May? (there is no entry for 20th may yet - so do I create it myself?)
    3) if in the question 2 above, i do create it myself, there's the issue of the locking mechanism shown to prevent concurrency issues here. can't take a lock on something not created in the first place. maybe I lock 17th May and 18th May and create 19th and 20th May ?
    4) what if i do that and someone else also wants a booking for hotel_id = 10 and room_type_id = 1 for dates 17th May - 20th May? (same dates), now they got a lock on 19th and 20th May and not on 17th and 18th? is that a failed operation?
    5) how do I create the 19th and 20th May entry in the first case? lock 17th and 18th? then see oh well 18th is the latest I could get...well after that
    rooms_available = total_rooms?
    2) The booking deduplication logic.
    Question:
    1) Do we also move the cancelled bookings to cassandra? otherwise the hash might result in the same booking_id where the payment failed. The user can't try again?
    Thank you in advance for your help! 😄

  • @sanjubaba1339
    @sanjubaba1339 10 місяців тому +4

    Hey Aanshul, thanks for this great system design explanation.
    Could you please create system design for below topics as well.
    1. Text streaming - A person is coding and others can watch him code in real-time.
    2. Delivery through drones system (with 1 million drones available for delivery).
    3. Bicycle renting system.
    4. Log aggregation platform.
    5. Video streaming.
    Thanks!

    • @SCALER
      @SCALER  10 місяців тому

      Hi Sanjay, we have duly made a note of your suggestion and it will be passed on to our relevant teams. Thank you! 😊

  • @CaioLouro
    @CaioLouro Місяць тому +1

    Great video, lots of in-depth content!
    I think the search use case is incomplete as filtering by rate is a pretty basic requirement. Besides that, I miss more details on the sharding implementation and strategies, that's complex and usually not well covered

  • @rabindrapatra7151
    @rabindrapatra7151 3 місяці тому +2

    Search is a major functionality. we should add more details into it.

  • @joshuaokoro9447
    @joshuaokoro9447 17 днів тому

    Correct me if I'm wrong, but it seems like when the inventory is decremented and gets to zero, it will block out bookings for rooms on booked and unbooked dates.
    Example
    room_type_id = 1
    total_rooms = 2
    available_rooms = 2
    User 1 creates a booking for
    check_in_date = 2024-december-15
    check_out_date = 202-december-18
    This decrements available_rooms = 1
    User 2 creates a booking for
    check_in_date = 2024-december-20
    check_out_date = 202-december-25
    available_rooms = 0
    User 3 tries to create a booking for
    check_in_date = 2024-december-26
    check_out_date = 202-december-29
    Following the design, this will return a message to user 3 that there are no rooms for the provided date since the available rooms have been decremented to zero.
    Is decrementing the inventory the way to go, or am I missing something from the explanation that should prevent that?

    • @yashnasery8501
      @yashnasery8501 4 дні тому

      The inventory table seems to have a date field as well, so it is like
      room_type_id = 1
      total_rooms = 2
      available_rooms = 2
      date = 2024-december 14
      room_type_id = 1
      total_rooms = 2
      available_rooms = 1
      date = 2024-december-15
      room_type_id = 1
      total_rooms = 2
      available_rooms = 1
      date = 2024-december-16
      room_type_id = 1
      total_rooms = 2
      available_rooms = 1
      date = 2024-december-17
      room_type_id = 1
      total_rooms = 2
      available_rooms = 1
      date = 2024-december-18
      Then I think (IDK if it has been covered yet till 01:09:53) since your new booking dates don't overlap, you infer that every room is available, since you date is greater than 18 (latest date for the second booking). Creating this new entry will need again race case checks, as you need to know which booking creates a new entry for a new date first.
      Now comes two things (again IDK if it has been covered yet till 01:09:53)
      1) To see if you can actually book a new booking from let's say 16 - 20, you check the number of rooms you want (in your case 1) is available on each date, if no, it fails, if yes, you decrement (need to check race conditions here).
      2) Clean up the table for past dates or completed or cancelled bookings maybe.

  • @theseriousguy2136
    @theseriousguy2136 5 місяців тому +1

    Can anyone help me in clarifying my doubt?
    Suppose admin updated the rate of a room by using the Hotel Service, and this is updated in the SQL cluster 1 ( used by the hotel Service). And this hotel service creates an event in the Kafka Queue, and the rate consumer listens to it and updates in the Rate Table maintained in the SQL Cluster2 ( used by inventory service). This updating is an asynchronous task , so might be the case that the hotel price might not have been updated in the rate table of 2nd cluster, and the user is able to book at the older price?

  • @KishoreKumar-fg6vf
    @KishoreKumar-fg6vf 3 місяці тому

    Hotel Inventory data is owned by a different service. Could you clarify how Booking service can access the Inventory data? Does the booking service directly query Inventory Database?

  • @InvincibleMan99
    @InvincibleMan99 3 місяці тому

    You have not covered the part where a user has to check availability of rooms in future date.
    Select count(bookings) as bookings_count from bookings where room_type_id=1 and hotel_id=1 and status='Reserved'
    Available Rooms = Total Rooms - bookings_count

  • @rabindrapatra7151
    @rabindrapatra7151 3 місяці тому

    Estimation does not include storage. It looks like purely scripted rather than experience.

  • @iswariakandarpa
    @iswariakandarpa 4 місяці тому +4

    You have overly complicated the system design

    • @rabindrapatra7151
      @rabindrapatra7151 3 місяці тому

      It must be finished in 30 minutes - 45 minutes

  • @gokukakarot6323
    @gokukakarot6323 Місяць тому

    One of the important things in hotel booking and room booking is reviews. Although it’s not that complicated . Shard, replicate and cache. But overall thanks for showing how to present, that’s very helpful

  • @kavitachawla3323
    @kavitachawla3323 9 місяців тому +1

    Users can filter search based on rates too. Why can't the rates be stored in ELK?

    • @Paradise-kv7fn
      @Paradise-kv7fn 4 місяці тому

      1 - ELK is set of technologies for logging, searching and visualization. Here, we on'y need ElasticSearch to perform searches.
      2 - Yes you are correct about the filtering part. We will need to store all the necessary attributes in each document in ES on the which the user can filter on.

  • @InvincibleMan99
    @InvincibleMan99 3 місяці тому

    Why Rate consumer svc has to be separate svc? we can create consumer in rate service itself?

  • @eprohoda
    @eprohoda 10 місяців тому

    Scaler,Woohoo. like it- breathtaking trip~ 🌟

  • @ShivangiSingh-wc3gk
    @ShivangiSingh-wc3gk 2 місяці тому

    A system design interview will be 45 min max, what are the basics that we need to cover for that interview ?

    • @DmitryKrasnikov
      @DmitryKrasnikov 19 днів тому

      look at c4 model notation and try to build c2 scheme at interview. That will be enough for almost all cases.

  • @Paradise-kv7fn
    @Paradise-kv7fn 4 місяці тому

    for 1:30:00, I think there might be an issue here. Lets say a hotel has 10 rooms and a user A is trying to book 2 rooms. User B also is trying to book 2 rooms for the same checkin/checkout date. Here, if we put a lock on the entire rows for the checkin-checkout-hotelId-roomId combination, it would unnecessarily lock block either A or B(depending on who gets the lock first) because A and B don't need to wait for the status of each other as the number of rooms available > the number of rooms needed by both A and B(i.e 4).
    A better way would be to actually decrement the number of rooms available as soon as the book button is clicked irrespective of whether the payment would succeed or not.
    If the payment succeeded, we don't need to do anything but if it fails, then we can increment the counter again.

    • @rabindrapatra7151
      @rabindrapatra7151 3 місяці тому

      what if user A trying to book. H1-R1 and user B also trying to book same H1-R1 on same date.

    • @Paradise-kv7fn
      @Paradise-kv7fn 3 місяці тому

      @@rabindrapatra7151 there still wouldn’t be any issues.

  • @iswariakandarpa
    @iswariakandarpa 4 місяці тому

    you have overly complicated system design

  • @aman8244
    @aman8244 3 місяці тому

    Amazing video, covered all necessary info

  • @hypein2297
    @hypein2297 8 місяців тому +1

    1:35:40

  • @amitrastogi1405
    @amitrastogi1405 7 місяців тому

    Excellent video on booking system design...Thanks!

    • @SCALER
      @SCALER  7 місяців тому

      Happy to hear that! 🙌🏼

  • @SopneshGandhi
    @SopneshGandhi 7 місяців тому

    1:23

  • @peterr765
    @peterr765 6 місяців тому +1

    This is amazing. Over an hours worth of concise and cohesive information with no fluff. This may be one of the best video systems designs I have seen.