How Booking com designed and scaled their highly available and performant User Review System

  Рет қаралды 21,843

Arpit Bhayani

Arpit Bhayani

Күн бұрын

System Design for SDE-2 and above: arpitbhayani.me/masterclass
System Design for Beginners: arpitbhayani.me/sys-design
Redis Internals: arpitbhayani.me/redis
Build Your Own Redis / DNS / BitTorrent / SQLite - with CodeCrafters.
Sign up and get 40% off - app.codecrafters.io/join?via=...
In the video, I explained how Booking.com designed a highly available and performant rating and review service to handle peak traffic of over 10,000 requests per second. I also touched on my system design course, focusing on real-world system building. I discussed the importance of authentic reviews driving decision-making and the criticality of a reliable review system for Booking.com. The video delved into the technical aspects of the system, highlighting the use of caching, materialized views, sharding, consistent hashing for routing, and practical node resizing strategies for scalability.
Recommended videos and playlists
If you liked this video, you will find the following videos and playlists helpful
System Design: • PostgreSQL connection ...
Designing Microservices: • Advantages of adopting...
Database Engineering: • How nested loop, hash,...
Concurrency In-depth: • How to write efficient...
Research paper dissections: • The Google File System...
Outage Dissections: • Dissecting GitHub Outa...
Hash Table Internals: • Internal Structure of ...
Bittorrent Internals: • Introduction to BitTor...
Things you will find amusing
Knowledge Base: arpitbhayani.me/knowledge-base
Bookshelf: arpitbhayani.me/bookshelf
Papershelf: arpitbhayani.me/papershelf
Other socials
I keep writing and sharing my practical experience and learnings every day, so if you resonate then follow along. I keep it no fluff.
LinkedIn: / arpitbhayani
Twitter: / arpit_bhayani
Weekly Newsletter: arpit.substack.com
Thank you for watching and supporting! it means a ton.
I am on a mission to bring out the best engineering stories from around the world and make you all fall in
love with engineering. If you resonate with this then follow along, I always keep it no-fluff.

Пікірлер: 45
@architshukla8076
@architshukla8076 Жыл бұрын
Very Informative video Arpit...Thanks :)
@gauravraj2604
@gauravraj2604 Жыл бұрын
liked your explanation Arpit. Thanks a ton
@atuljoshi6182
@atuljoshi6182 Жыл бұрын
Excellent explanation .
@Aditya-us5gj
@Aditya-us5gj Жыл бұрын
Hi Arpit, thanks for this channel. I was utilising it to fullest before I discontinued because of lack of dedication and consistency. And now when I visit videos section, I'm f**ked up how to cover all these gems. Not sure to bing watch them on weekends or to keep them aside for a while and start covering daily videos consistently.
@adianimesh
@adianimesh Жыл бұрын
30 minute a day ! thats how I do it .. will catch up eventually
@tarunpahuja3443
@tarunpahuja3443 Жыл бұрын
What if the master shard goes down during write re and quest. I guess here we could avoid strong consistency for available
@abhis3kh
@abhis3kh Жыл бұрын
Hi Arpit, Got some questions. If you can answer it will be awesome. 1. Consistent hashing will be used for writing the data as well to DB right? 2. What happens if we remove one node from a ring of 4 & that removed node contains some data. So how to determine which Node we should transfer our data from that removed node? 3. How the cache will be updated in real time? Does it got updated when user create/update a rating, or it will fetch data from DB? Cache is of limited size so what would be the best approach for storing data: I think it should be LFU. What your views? 4. How to route the request in case a node goes down? Are we adding that item (another node from other AZ1) to consistent hashing ring or how?
@AsliEngineering
@AsliEngineering Жыл бұрын
1. Yes. It spits out data ownership. 2. Consistent hashing spits out that info 3. Depends on the usecase not one correct answer here. LFU with exponential decay can also work fine. 4. That's the recovery handler written in the routing layer (API servers) in this case. Or a separate component.
@abhis3kh
@abhis3kh Жыл бұрын
@@AsliEngineering Thank you :)
@ng.manisha
@ng.manisha 3 ай бұрын
What will be the structure of the redis key and value? Also, for DB sharding, we don't generally recommend sharding for rdbms systems right? because joining data across multiple shards are costly? How does this get managed? Shouldn't we use cassandra here?
@microtech2448
@microtech2448 Жыл бұрын
How would data integrity be handled when shards are added or removed?
@user-bs7dh4nq4i
@user-bs7dh4nq4i 6 ай бұрын
In Japan, last year 2023, some hotels owners did large lawsuit agajnst Booking, because of payment delay. Booking side execuse was System trouble.
@Amritanjali
@Amritanjali Жыл бұрын
thanks🙏
@koustavdas2519
@koustavdas2519 Жыл бұрын
Hi Arpit. If we use NOSQL here what DB would you suggest a Cassandra or MongoDB? I know Cassandra is write efficient. But what about reads? And personally which DB would you choose? @AsliEngineering
@utsavprabhakar5072
@utsavprabhakar5072 Жыл бұрын
Do we shard databases ourselves? Like in dynamo db, sharding is handled on its own. There is a provision I guess to shard but thats not usually used by anyone. Can you give some real world examples of where consistent hashing is done nowadays? (given db requirements are handled by cloud service providers and autoscaling, provisioning and sharding is done by the database automatically?
@AsliEngineering
@AsliEngineering Жыл бұрын
depends on the database you are using. in managed db we need not do anything but if you are self hosting then yes.
@utsavprabhakar5072
@utsavprabhakar5072 Жыл бұрын
@@AsliEngineering got it, thanks!
@piyush3168
@piyush3168 Жыл бұрын
very good explanation ! does writing service will scale ? as we have only one master node , or Cassandra ( multiple writers) will be good choice for that ? , as we are not looking for acid compliant behaviour
@girishanker3796
@girishanker3796 28 күн бұрын
A Cassandra cluster would be a great choice. +1 but since he mentioned trade offs I think we can trade off consistency for availability (so maybe 2 write masters which will be eventually consistent)
@jayantprakash6425
@jayantprakash6425 Жыл бұрын
when the new ring is being prepared, are reads/writes served by old ring? Is there any downtime associated?
@AsliEngineering
@AsliEngineering Жыл бұрын
nope. no downtime needed.
@shubhamtyagi5219
@shubhamtyagi5219 Жыл бұрын
When we are creating new ring, how do we know which requests need to be relocated because we would be moving some keys from the older shard to new shard. How to find which key?
@AsliEngineering
@AsliEngineering Жыл бұрын
Changes happen atomically all at once.
@tesla1772
@tesla1772 Жыл бұрын
Hi aprit, i have one question that all this data migration that we have to do how is it done?. Do we write our own scripts for it to first migrate and then inform services about new node . What is the right way of handling this
@AsliEngineering
@AsliEngineering Жыл бұрын
Yes. We write the scripts.
@mahendratonape27
@mahendratonape27 9 ай бұрын
what if routing decision is made by db router instead of consistent hashing algo written in routing service, i think db written routing alog is better than our own consistient hashing algo
@maheshkumartangella5516
@maheshkumartangella5516 3 ай бұрын
I had the exact same question, why do we want to recreate what database could already do, routing its requests to corresponding shards
@hackwithharsha
@hackwithharsha Жыл бұрын
00:19:00 Thank You… If we use asynchrous replication.. How do we handle replication lag ? For example, Imagine If I have written a review for hotel which goes to master and then immediate read query went to replica which has’t recieved replica data yet… In the userinterface, User might think something went wrong with his submitted review and they will resubmit it too ? How do we handle this situation ?
@AsliEngineering
@AsliEngineering Жыл бұрын
You will ensure Read Your Write consistency by redirecting the critical reads to the master.
@gauravraj2604
@gauravraj2604 Жыл бұрын
@@AsliEngineering Read Your Write consistency, is this any specific case we should wonder about while using master-slave replication?
@robinpaulification
@robinpaulification 3 ай бұрын
08:50 it is two regions and not AZ
@SwikarP
@SwikarP 7 ай бұрын
Best best best awsome
@bharatarya7929
@bharatarya7929 Жыл бұрын
Hi! Nice video can u share your thoughts on how Rapido is keep a constant OTP of 4 digits for all users.
@AsliEngineering
@AsliEngineering Жыл бұрын
Have never used Rapido. So no idea about it.
@bharatarya7929
@bharatarya7929 Жыл бұрын
@@AsliEngineering so while booking any cab via any app like Uber, Ola etc. They all share a OTP for the ride which keeps on changing. But rapido keeps a constant OTP for users which is 4 digits so how they are managing large scale
@AsliEngineering
@AsliEngineering Жыл бұрын
@@bharatarya7929 then OTP are not unique just a random number assigned to a user.
@boombasach
@boombasach 9 ай бұрын
Thanks
@AsliEngineering
@AsliEngineering 9 ай бұрын
Thank you so much for the kind gesture :)
@niksgupt
@niksgupt Жыл бұрын
Great use case and amazing presentation. Wondering, any specific reason for using relational db? Can't we solve it using NoSQL db?
@AsliEngineering
@AsliEngineering Жыл бұрын
You can so long as it fits the usecase. No hard bounds.
@d4devotion
@d4devotion Жыл бұрын
So it turned out to saying that even reviews on your System-Design-Master-Class are playing a vital role. (You will come to know what I meant to say in your next cohort :) )
@AsliEngineering
@AsliEngineering Жыл бұрын
heheheh. suspense :) looking forward to it :)
@abhis3kh
@abhis3kh Жыл бұрын
Can we get twitter design video based on the diagram shared by Elon Musk ?
@AsliEngineering
@AsliEngineering Жыл бұрын
I thought about it, but that diagram is really very very very high level. THey are literally just a bunch of microservices. If I create a video on it, no one will learn anything concrete from it. It will just be a list of microservices and guessing what it does. Say, I create a 20 min video on it, that will definitely get me views, but will add nothing to the viewer. Thank you so much for suggesting this, but I really do not want to waste the time of anyone watching my video. I like to keep the video information dense and useful. Hope you understand.
@abhis3kh
@abhis3kh Жыл бұрын
@@AsliEngineering Sure. That makes sense :)
Database Sharding and Partitioning
23:53
Arpit Bhayani
Рет қаралды 71 М.
Does size matter? BEACH EDITION
00:32
Mini Katana
Рет қаралды 19 МЛН
Despicable Me Fart Blaster
00:51
_vector_
Рет қаралды 22 МЛН
One moment can change your life ✨🔄
00:32
A4
Рет қаралды 29 МЛН
БОЛЬШОЙ ПЕТУШОК #shorts
00:21
Паша Осадчий
Рет қаралды 11 МЛН
Designing Idempotent API Endpoints for Payments at Stripe
14:26
Arpit Bhayani
Рет қаралды 22 М.
How DNS really works and how it scales infinitely?
16:35
Arpit Bhayani
Рет қаралды 22 М.
Designing Notifications Service for Instagram
37:18
Arpit Bhayani
Рет қаралды 66 М.
How Razorpay scaled their notification system
17:32
Arpit Bhayani
Рет қаралды 19 М.
Consistent Hashing - System Design Interview
11:42
High-Performance Programming
Рет қаралды 14 М.
Understanding Proxy, Forward Proxy, and Reverse Proxy
9:41
Arpit Bhayani
Рет қаралды 25 М.
How do indexes make databases read faster?
23:25
Arpit Bhayani
Рет қаралды 55 М.
Как правильно выключать звук на телефоне?
0:17
Люди.Идеи, общественная организация
Рет қаралды 1,7 МЛН
Красиво, но телефон жаль
0:32
Бесполезные Новости
Рет қаралды 1,3 МЛН
Как распознать поддельный iPhone
0:44
PEREKUPILO
Рет қаралды 2 МЛН
Телефон-електрошокер
0:43
RICARDO 2.0
Рет қаралды 1,3 МЛН
Отдых для геймера? 😮‍💨 Hiper Engine B50
1:00
Вэйми
Рет қаралды 1,2 МЛН