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

Поделиться
HTML-код
  • Опубликовано: 21 ноя 2024

Комментарии • 35

  • @SCALER
    @SCALER  11 месяцев назад +2

    Learn more about Scaler: bit.ly/41jAQkp

  • @CSKnowledge007
    @CSKnowledge007 12 дней назад

    I liked the CDN, elasticsearch, kafka part. That was something new, unlike regular HLD videos where people just draw some server, DB, loadbalancer etc. Planning of microservices and DB can be done easily once fundamentals are clear. But knowing what tech service to use is the important part.

  • @peterr765
    @peterr765 8 месяцев назад +2

    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.

  • @sanjubaba1339
    @sanjubaba1339 11 месяцев назад +5

    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  11 месяцев назад

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

  • @yashnasery8501
    @yashnasery8501 Месяц назад +2

    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! 😄

  • @gokukakarot6323
    @gokukakarot6323 3 месяца назад

    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

  • @rabindrapatra7151
    @rabindrapatra7151 4 месяца назад +2

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

  • @CaioLouro
    @CaioLouro 3 месяца назад +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

  • @Paradise-kv7fn
    @Paradise-kv7fn 6 месяцев назад

    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 4 месяца назад

      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 4 месяца назад

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

  • @ajitsinghbisht1419
    @ajitsinghbisht1419 5 дней назад

    Hi, Just going through video and noticed that you have created around 2-3 copies of hotel , room and other data in multiple sql and nosql dbs. is this normal for systems to duplicate the data ?

  • @amitrastogi1405
    @amitrastogi1405 9 месяцев назад

    Excellent video on booking system design...Thanks!

    • @SCALER
      @SCALER  9 месяцев назад

      Happy to hear that! 🙌🏼

  • @eprohoda
    @eprohoda 11 месяцев назад

    Scaler,Woohoo. like it- breathtaking trip~ 🌟

  • @aman8244
    @aman8244 5 месяцев назад

    Amazing video, covered all necessary info

  • @KishoreKumar-fg6vf
    @KishoreKumar-fg6vf 5 месяцев назад

    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?

  • @kavitachawla3323
    @kavitachawla3323 11 месяцев назад +1

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

    • @Paradise-kv7fn
      @Paradise-kv7fn 6 месяцев назад

      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.

  • @hypein2297
    @hypein2297 9 месяцев назад +2

    1:35:40

  • @ShivangiSingh-wc3gk
    @ShivangiSingh-wc3gk 3 месяца назад

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

    • @DmitryKrasnikov
      @DmitryKrasnikov 2 месяца назад

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

  • @InvincibleMan99
    @InvincibleMan99 4 месяца назад

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

  • @joshuaokoro9447
    @joshuaokoro9447 2 месяца назад

    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 Месяц назад

      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 7 месяцев назад +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?

  • @InvincibleMan99
    @InvincibleMan99 4 месяца назад

    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

  • @SopneshGandhi
    @SopneshGandhi 8 месяцев назад

    1:23

  • @prakharjain-r6t
    @prakharjain-r6t 2 месяца назад +1

    Super great explanation. super bad drawing.

  • @rabindrapatra7151
    @rabindrapatra7151 4 месяца назад

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

  • @iswariakandarpa
    @iswariakandarpa 6 месяцев назад +6

    You have overly complicated the system design

    • @rabindrapatra7151
      @rabindrapatra7151 4 месяца назад

      It must be finished in 30 minutes - 45 minutes

  • @iswariakandarpa
    @iswariakandarpa 6 месяцев назад

    you have overly complicated system design