January 10, 2021

Distributed Consensus and Data Replication strategies on the server

We talk about the Master Slave replication strategy for reliability and data backups. This database concept is often asked in system design interviews with discussions on consistency and availability tradeoffs.

Very closely tied to the master slave architecture is the concept of distributed consensus. When designing a system, we must make sure that the individual components can agree on a particular value. (Leader election, distributed transactions, etc…) Some popular techniques are 2 phase commit, Multi Version Concurrency Control, SAGAs and Quorum.

0:00 Problem Statement
0:53 Replication
1:24 Synchronous replication vs. Asynchronous replication
3:36 Peer to Peer data transfer
4:44 Split brain problem

Also useful when used with Master Slave replication is sharding. You can check out the video mentioned below.


Made by engineers from Google and Uber, this site helps you build your algorithmic skills using code and white board explanations.
Be sure to use the code ‘gaurav’ for the discount. You get 15% off!

System Design Course:

System Design Playlist:
Designing Data Intensive Applications –

You can follow me on:

#SystemDesign #Databases #Replication

Nguồn: https://liberty2010.org/

Xem thêm bài viết khác: https://liberty2010.org/game/

in Game
Related Posts

Nạp 8Tr5 ATM Chơi BINGO Thanh Niên May Mắn : Lấy Hoopa Đầu Tiên Server – Cuối Năm Triệu Hồi Hoopa

July 18, 2020

July 18, 2020 20

Cám Ơn Các Bạn Đã Xem Video – Clip – Của Mình….. – Facebook Miu Lì Ham Chơi : –...

USA Trench VS HUGE Chinese army ! Operation Anchorage – Fallout Mod

July 23, 2020

July 23, 2020 37

Operation Anchorage has begun ! Go sub to Baron – previous video : Sponsor my channel by becoming a patron?...

How To Play Straight Shooter (Dice Game)

July 27, 2020

July 27, 2020 4

This video tutorial will teach you how to play the dice game Straight Shooter. More information can be found at...

BTS(방탄소년단) – Outro:Wings[Live Video]

July 22, 2020

July 22, 2020 32

#BTS #WINGS I didn’t make any money for this video, all copyright belong to Bighit Entertainment Purpose is to promote...

Bad Santa (10/12) Movie CLIP – Nutcracker (2003) HD

July 24, 2020

July 24, 2020 36

Bad Santa movie clips: BUY THE MOVIE: Don’t miss the HOTTEST NEW TRAILERS: CLIP DESCRIPTION: Enlisting the help of Marcus...

Toss a Coin to Your Witcher (Carnival Game Cover)

July 26, 2020

July 26, 2020 35

Toss a coin to your Witcher! It was stuck in everyone’s head. I couldn’t escape it. But somewhere along the...

Super McDonalds Bros: Quest for the Golden Arches (Mario)

July 27, 2020

July 27, 2020 27

Subscribe for more videos! ►► Mario 64, but it’s not? ►► Rapper Drake LOVES Mario? ►► Nintendo’s Super Mario Bros...

Fallout Operation Manhattan – EP1

July 19, 2020

July 19, 2020 31

Join me in my new miniseries as I join up with the Brotherhood of Steel in the Operation Manhattan mod....

Dell XPS 15 (7590 2019) Ultimate Render Test – H264, H265 – 1080p, 4K – Max Depth & More.

July 25, 2020

July 25, 2020 8

In this video I have conducted 16 tests! Settings vary between H.264, H.265 Full HD 1080p, 4K 2160p, Max Depth...

Blitz Bowl – How To Play

July 26, 2020

July 26, 2020 45

Watch It Played is a series designed to teach and play games. In this video we’re going to learn how...

Quickselling Forte For Harambe #BlessUp

July 27, 2020

July 27, 2020 28

If Harambe were here he would agree with my decision The meme is not dead Thanks a ton for watching...

SQUAD Alpha – Render Test [60FPS – 4K downscaled]

July 26, 2020

July 26, 2020 9

Recently I updated my recording software for Squad to Dxtory with UtVideo YUV422 BT.709 codec, which allows a nearly loseless...

ICE Super Chexx Pro | #1 In Bubble Hockey Entertainment | Bring Home The Dome

July 20, 2020

July 20, 2020 4

Since 1982, ICE has brought arcade quality bubble hockey games to generations of families and friends. Your Super Chexx Pro...

ACADe Drawing Design (Basic/2D) Book's Tutorial | CH5

July 27, 2020

July 27, 2020

বাংলা ভাষায় প্রথম প্রকাশ ‘প্রফেশনাল অটোক্যাড ইলেকট্রিক্যাল ড্রয়িং ডিজাইন (বেসিক/2D)’ বইয়ের চ্যাপ্টারভিত্তিক ভিডিও টিউটোরিয়াল। এটি হচ্ছে পঞ্চম অধ্যায়ের ভিডিও যেখানে...

How to Play Pokeno Easy New Fun!

July 25, 2020

July 25, 2020 3

How to Play Pokeno Easy Fun New! In this video you will learn How to Play Pokeno Easy New Fun!...

  • Hey man, awesome Videos on important topics! Actually, I haven't come across any other good source on Systems Design.

    Can you recommend some literature or a crash course on Systems Design? Or maybe you can make a whole course, going from topic to topic in a structured manner, more like how the topics are structured in a book, so that it can serve as a starter basic overview on the whole field.
    Cheers 😉

  • In many Amazon interviews, they usually ask Command execution framework design and play store design. Can i have material for that?

  • If there is single database, my application is scaling up in terms of user then the load balancer will not help, all the load will be in single database, for that how to serve fast in terms of user experience(read/write), how to scale or design the database??? i m seeking help for sql server

  • 06:00 The balance deduction thing, the 2 messages deduction 100 and deduction 50 are different messages right ? so what's wrong with deducting 150 ? I think I am missing a key point.

  • Hi Gaurav.
    I have been going through your blogs for a while now and they helped me ace my WalmartLabs interview where i started a couple of months back.
    Litlle context on the practical application of this video, this is a very common problem in distributed systems where solution to the problem through only sharding is prettymuch rare as data is expected to be available anywhere and everywhere.
    I have been using Microsoft's offering of AZURE COSMOS DB which is a planet scale document based db solution where you get triggers or events when the state of your data changes so that it can be asynchronously communicated to other nodes/clusters. So, AZURE COSMOS DB offer's the option of multiple master for writes which asynchronously sync with each other and in case if a conflict there are 2 options _ the last write wins / you can execute a stored proc for some custom logic. So all of this is very relevant.

  • Great content (upvoted and subbed). Don't see any other channel with short and precise summaries of fairly complicated concepts.

    One more benefit of Master-Slave – Move replicated data closer (geographically) to the end user. For better user experience – lower latency.
    Also sharding and replication scheme are tangential and often work in tandem. Generally you will have sharded databases with each shard replicated. Replicated shard could be a slave or a master (consensus based).

    I vote for distributed consensus. In fact this would cover the meat of distributed systems and could be broken down into multiple smaller introductory videos
    Video 1> Inherent problems with distributed systems (failure detection, n/w partitions, byzantine(non) faults, clock skews).
    Video 2> Why do we need consensus ? Protocols to tackle #1 and what they tradeoff to offer consensus (CAP axis). Protocols – 2pc, 3pc, paxos (intro).
    Video 3> Real applications and tradeoff they make for better performances. (Why distributed acid applications are hard and to be avoided).

    I see lot of interviewees(i'm interviewer in one of the FANG) have surface knowledge of these concepts and often incorrectly adjust to a constraint (been guilty myself). Content like yours can help someone find gaps in their understanding.

  • Hi Gaurav, awesome video.
    Do you happen to know which system design is probably used in the scenario when you run out of locks during distributed consensus pretty fast. Something like rate limiting for acquiring locks ?

  • If our system has 'n' replicas, which replica amongst those 'n' stand chance to be master? What is the criteria for selecting one single replica amongst pool of replicas?

  • Excellent video as always gaurav.
    A few points from my side.
    1. Taking snapshots at regular intervals of the db is one way to avoid the single point of failure.
    2. Log reconstruction is one more way. Before writing to the db first flush to a log file. So if the db crashes the log file can be used to restore the db.
    3. I think when you talk about the databases communicating with each other , you mean there is an API that sits in front of them and these API's communicate with each other.
    Or is it that there is an API in front of the db which writes to a queue and another process that polls the queue and talks to the second db.
    4. One way to deal with the split brain problem is through the paxos algorithm.

    Great job and thanks !!! 🙂

  • Why don't you make a technical meme page. Where we get knowledge with laughter. haha 😛
    Amazing video and amazing memes in between 😛

  • Hi Gaurav,
    Nice video. I have some elementary doubts.
    1) how communication between two DB could get broken which results in Split brain problem. My guess is they communicate on particular port. Closing of port is only way to cause this issue.

    2) how master master architecture is achieved in DB. Bcz server would be configured to sent data to particular DB say DB1, howcome data could be dynamically sent to DB2. As much I know there is no load balancer behind DB set up.

    Thanks lot.

  • hey can you slow down your speed a bit. looks like its 1.3x instead of 1.0x. i know you get excited but if you can tone down your speed people can follow a bit better.

  • Hey, another great video. But i have some doubts regarding how states are maintained. Say there are 3 nodes(A,B,C), each at state S0. Link between A and B is broken. A gets an update and propogates it to C and now both of them are on state S2. Now if C gets an update and tries to propogate it to B, B will take note the C's state is not the same as its own. So….how will it be decides who is ahead and who is behind? According to your example, B will just tell C to rollback and force its own state onto C which is not right. So how will this work?

  • Hello Gaurav. Just want to ask what is your view on data science in industry field? Are you planning to switch to data science field in the near future?

  • HI! i love your competitive programming videos. do u think you can make a serie of fendwick tree (some applications of it in problems, not the theory). i think it is hard to conceptualize a problem and using fendwick tree to solve it, so it would be really helpful.

  • Hi Gaurav , this was very helpful video to understand master slave architecture , I have few queries like what if load balancer itself goes down , how master and slave notify each other I mean what mechanism they will use so that both with will be in synch? I am facing one problem with load balancer I have posted the question in stackoverflow https://stackoverflow.com/questions/54923637/wildfly14-undertow-load-balancer-is-retriggering-the-rest-call-internally
    could you please suggest me here what I am doing worng ?

  • Nice work Gaurav! This is the only channel for which I have enabled notifications. You are helping the whole community. Thanks a lot.
    PS: start an instagram page and post all these memes there also.😀

  • Your videos are great and you've done a great job in your explanations. You should do a video on book recommendations that aid people on learning about systems design thinking in this way.

  • Hi Gaurav, good video. Can you make a video over "how large scale Indian Unified Payment Interface works"? Focus on technical/Networking and Database aspects. Thanks !!!

Leave a Reply

Your email address will not be published. Required fields are marked *