Hotel Reservation (AirBnb, Booking.com) - System Design Interview Question

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

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

  • @kyngcytro
    @kyngcytro 20 дней назад +5

    This confirmed my head was in the right place. Didn't think of the idempotency stuff tho. Thanks well explained.

  • @jdxxmxnd
    @jdxxmxnd 19 дней назад +8

    What sort of intense processing is being done to create hotels? The message queue on that path seems a bit overkill.

    • @haodeng9639
      @haodeng9639 18 дней назад +1

      agree, over design.

    • @dev_yethiha
      @dev_yethiha 17 дней назад +1

      Yeah, i also think the same but after deep consideration when creating or manipulate hotels data, we need to update it in two place. Which is Elastic Search And database. We need to store in database first and after that we need to move the data to elastic a do reindexing.

    • @jjverce
      @jjverce 2 дня назад

      @@dev_yethiha that's fine, that's something pretty basic that most web apps do. You don't need to decouple these requests with an intermediate queue for that though. You can just trigger the Elasticsearch update in response to DB updates, without hurting the UX of a request that the user doesn't know if it succeeded or not anymore. Imagine a user trying to make a bunch of changes in their admin dashboard and having to refresh the browser after each step because they're not sure if the last update succeeded or not.

  • @Scalabilis
    @Scalabilis 17 дней назад +1

    Thanks for sharing such valuable content soo helpful brother💪

    • @TechPrepYT
      @TechPrepYT  14 дней назад

      Appreciate the kind words!

  • @harshaghanta1
    @harshaghanta1 20 дней назад +14

    What tool are you using to create these diagrams?

  • @giantbush4258
    @giantbush4258 21 день назад +1

    Well explained.

  • @abhishekgautam1651
    @abhishekgautam1651 18 дней назад +1

    Good explanation

  • @felipecaldeira1999
    @felipecaldeira1999 10 дней назад +1

    The hotel creation side seems a bit overengineered, or at least not well-justified... Why do we need an "Admin Queue" - is hotel/room creation really that frequent and resource intensive? And who is being notified about hotel/room creation?? I'm sure one could come up with reasons, but without explicitly stating said reasons, it seems unnecessary.

  • @antonbogdanovich9707
    @antonbogdanovich9707 12 дней назад +1

    Is room_inventory table along enough for the booking availability search within a date range? What if I would like to book a room for 3 consecutive days and there is an availability for each particular day, but there is no consecutive availability of a particular room. There could be 3 different rooms available at every particular day within a date range.

    • @TheLemitek
      @TheLemitek 3 дня назад +1

      Yes, you are correct. I think to prevent this error and make it simplier we would have to calculate each time a client asks about specific range (and maybe store it in some cache) from reservation table.
      Something like this I think
      WITH ReservedRooms AS (
      SELECT
      roomId
      FROM
      reservations
      WHERE
      roomTypeId = @roomTypeId
      AND (
      (CheckInDate @startDate)
      )
      )
      SELECT
      roomId
      FROM
      rooms
      WHERE
      roomTypeId = @roomTypeId
      AND roomId NOT IN (SELECT roomId FROM ReservedRooms);

  • @omkarjadiya7745
    @omkarjadiya7745 17 дней назад

    next one in telegram all feature 😄😄

  • @karpuzye
    @karpuzye 21 день назад

    DB tables should be the result of clear separation of responsibilities and domains.
    Starting with db tables to system design can mislead younger developers