Single Leader Replication - how it works | Systems Design 0 to 1 with Ex-Google SWE

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 พ.ย. 2024

ความคิดเห็น • 27

  • @manishasingh-de8hi
    @manishasingh-de8hi 5 หลายเดือนก่อน +5

    This entire system design playlist is awesome, so much is packed in these short videos, and your dry humour makes it even more fun to watch.👏

  • @thanujakumar5573
    @thanujakumar5573 8 หลายเดือนก่อน +6

    Bro you are awesome. Your sense of humor is too good, making learning system design fun

    • @jordanhasnolife5163
      @jordanhasnolife5163  8 หลายเดือนก่อน

      Thanks man! Glad you're sticking around :)

  • @777roadkill
    @777roadkill 3 หลายเดือนก่อน +1

    Hey Jordan, In a partitioned database that uses single leader replication, does each partition have it's own single leader or is there one leader across all partitions?

  • @sahilguleria6976
    @sahilguleria6976 3 หลายเดือนก่อน +2

    Hello Jordan(Single Leader, alpha male), As always great video
    I had a small query, as we have established replication can be achieved using Replication log. Just wanted to know how does this actually work between master and follower? Is it a process on master which keeps track of where exactly each follower is and pushes the difference OR each follower polls the master with last item it fetched and master sends back the new data it has.

    • @jordanhasnolife5163
      @jordanhasnolife5163  3 หลายเดือนก่อน

      I imagine there are multiple possible implementations. Perhaps the leader pushes, and then upon receiving a message a follower asks for backfills if it is behind.

  • @msebrahim-007
    @msebrahim-007 5 หลายเดือนก่อน +2

    In regards to second problem you mentioned when the leader goes down, specifically the case where writes 71-80 are lost since those writes were never replicated.
    I assume the new leader (previously the follower) begins accepting writes starting from write 71. When the initial leader that had gone down comes back online at a later point in time, the initial 71-80 records also come "back into existence".
    My question here is, in such a case do we really lose the 71-80 data?

    • @jordanhasnolife5163
      @jordanhasnolife5163  5 หลายเดือนก่อน

      1) Do they come back into existence? That's implementation specific. They may be outdated now and nonsensical.
      2) The node may never come back up! Maybe the hard drive gets fried by my 360 roundhouse kick

  • @danilaosipov9661
    @danilaosipov9661 ปีที่แล้ว +4

    Hey Jordan, thanks a lot for this content! It's especially cool that you draw, because it makes so much more sense :)
    Will you do the same "drawing" series with System Design Questions?

  • @yaswanth7931
    @yaswanth7931 6 หลายเดือนก่อน +3

    Hi Jordan, can you please share the resources for the system design which you follow?

    • @jordanhasnolife5163
      @jordanhasnolife5163  6 หลายเดือนก่อน +1

      I just pop around to random youtube videos at this point, ideally from actual conferences, since those are a lot more trustworthy than other TH-camrs lol

  • @huscooking
    @huscooking 7 หลายเดือนก่อน +2

    cant we just label a node as a leader / follower, or is this basically just what distributed consensus is?

    • @jordanhasnolife5163
      @jordanhasnolife5163  7 หลายเดือนก่อน

      Not so easy! What happens when your leader goes down? Like what you're saying, it's not enough to "label" something, every node has to agree on it (or at least a majority).

    • @yahyashaikh1412
      @yahyashaikh1412 3 หลายเดือนก่อน

      Initially node participate in an election as (follower or participant )where nodes shares their latest id wether be it a log id or id incremented by commit (depends on what algorithm you are using) if the participating node gets the id from the other participant node which is greater then it’s own it will vote for that node that’s how single node gets the majority and that node becomes the leader as soon as the leader is declared it spreads out the message to all the nodes of the quorum

  • @VedanshBansal-y8f
    @VedanshBansal-y8f 4 หลายเดือนก่อน +1

    In the leader goes down scenario 2 where we are loosing the data from 71-80. In this case don't we have a replication log for exactly that purpose. Like the leader wrote into the replication log till 80 and then dies. Since the follower is reading the replication log wouldn't it be able to get that data? Pls correct me if I am wrong!

    • @jordanhasnolife5163
      @jordanhasnolife5163  4 หลายเดือนก่อน

      Replication is done asynchronously. If the leader goes down before it sends its writes to the follower, and it never comes back up, the follower will never see those writes.

  • @y2k898
    @y2k898 ปีที่แล้ว +1

    Hey man I have been enjoying your system design concepts So far one suggestion I'd like to make is maybe you can talk along with your drawing (the 5 dollars white board you normally used in the end of each videos)
    I think this can really help the explanation, anyway keep up with the great worj

    • @jordanhasnolife5163
      @jordanhasnolife5163  ปีที่แล้ว +1

      Bit confused here as I'm certainly talking along with my drawings
      More problematically - the white board is gone :(

  • @rajanwaliya150
    @rajanwaliya150 6 หลายเดือนก่อน +1

    Typo in video description?
    It 'reminds' me of myself?

  • @IizalaarabElhaimeur
    @IizalaarabElhaimeur ปีที่แล้ว +4

    High Tech-Wizard 🌿🧑‍💻 Thanks for the hard work brotha

  • @LeoLeo-nx5gi
    @LeoLeo-nx5gi ปีที่แล้ว +3

    Thanks a ton!! Waiting for more such awesome/harder ones

  • @chaitanyatanwar8151
    @chaitanyatanwar8151 5 หลายเดือนก่อน +1

    Thanks!