Leaderless Replication Introduction | Systems Design 0 to 1 with Ex-Google SWE

  Рет қаралды 9,577

Jordan has no life

Jordan has no life

Күн бұрын

Пікірлер: 41
@jamesOwanga
@jamesOwanga Жыл бұрын
You genuinely have the best system design videos I’ve ever encountered, by a significant margin.
@jordanhasnolife5163
@jordanhasnolife5163 Жыл бұрын
Thanks James!! That's all I'm going for!
@leftyhero147
@leftyhero147 2 ай бұрын
Man U R the GOAT, I was looking for companion lectures for DDIA and found your playlist
@andriidanylov9453
@andriidanylov9453 Жыл бұрын
Cool. This kind of tree is surprising. Thanks for sharing
@KENTOSI
@KENTOSI Жыл бұрын
Hey thanks Jordan you explained this really well.
@the1anonymouse
@the1anonymouse 10 ай бұрын
Wouldn't there be a significant risk of data mismatch in the tree? What if one tree has 762 and 127 and the other has 761 and 128? Wouldn't that lead to a condition where one database mistakenly thinks the other has data that it doesn't?
@jordanhasnolife5163
@jordanhasnolife5163 10 ай бұрын
Well I'd say that as long as the way that we create the tree/hashes is deterministic that two nodes with the same data should not have that issue
@pintoo...387
@pintoo...387 6 ай бұрын
Hey Jordan, when the merkel trees mismatch and we found the row that is mismatching, which row of the two dbs do we pick?
@jordanhasnolife5163
@jordanhasnolife5163 6 ай бұрын
Whichever has the higher version vector or timestamp
@shineinusa
@shineinusa 6 ай бұрын
Multi leader and leader less replication looks almost same in the sense that we would be writing data to multiple nodes. My question is can we use crdt for replication in leader less system as well?
@jordanhasnolife5163
@jordanhasnolife5163 6 ай бұрын
I guess technically the merkle tree that we use in leaderless replication for anti entropy is kind of a type of CRDT
@IanOnYoutube
@IanOnYoutube 19 күн бұрын
How do Merkle trees handle Hash collisions? For example two x and y such that a=x and a=y both hash to 250? It's possible then for two merkle trees to think they are identical, when in fact they differ in one key-value!!
@jordanhasnolife5163
@jordanhasnolife5163 10 күн бұрын
Good question, certainly not one that I know the answer to, but I imagine in practice this barely ever happens, I'd give it a google!
@rahullingala7311
@rahullingala7311 11 ай бұрын
How do we have access to the other node's merkle tree, while doing the comparison? Would it be sent on network? Then it kind of defeats the purpose. Also the merkle tree can be huge if I understand correctly, kind of 2x the size of the DB. Isn't that a lot of data to communicate over the network from one node to another? May be I didn't understand correctly, please correct me if I'm wrong.
@jordanhasnolife5163
@jordanhasnolife5163 11 ай бұрын
Hey Rahul - you send the root hash of the merkle tree over the network first (small), which tells you if you have differences, and then just traverse down the merkle tree where the hashes are not the same to see the differences in rows. Merkle tree is just a tree of hashes. I have a dedicated video on them on my channel from a couple of years ago, maybe worth checking that one out!
@rahullingala7311
@rahullingala7311 11 ай бұрын
Ahh understood how that helps, thanks a lot! Will also checkout that video.
@sakshibhasin96
@sakshibhasin96 10 ай бұрын
If both the databases have multiple mismatched writes, then would the complexity still remain O(log n)? It could be possible that both the left and right nodes are mismatched, in which case both sub-trees will need to be traversed, thus making the time complexity greater than log n
@jordanhasnolife5163
@jordanhasnolife5163 10 ай бұрын
That's correct, in the worst case everything is different and now we have to linearly traverse the tree.
@sakshibhasin96
@sakshibhasin96 10 ай бұрын
@@jordanhasnolife5163 Thank you! And I love your videos!!
@josepha8415
@josepha8415 Жыл бұрын
Did you pass a systems design interview to get your current job ?
@jordanhasnolife5163
@jordanhasnolife5163 Жыл бұрын
Nope! Ironic isn't it? Passed other systems design rounds for different quant firms during the interview process
@dibll
@dibll Жыл бұрын
Could you pls do a video on Data Mesh technology? Thanks!
@jordanhasnolife5163
@jordanhasnolife5163 Жыл бұрын
Yeah I've gotta research this a bit more, not sure how relevant it is to the systems design interview.
@WoahImNIce112
@WoahImNIce112 Жыл бұрын
Being insane is part of what makes up a good engineer
@jordanhasnolife5163
@jordanhasnolife5163 Жыл бұрын
Insanity and laziness
@voldemort_3
@voldemort_3 Жыл бұрын
Loved it, let's implement it on postgres make two databases and ...
@rishabhgoyal8110
@rishabhgoyal8110 Ай бұрын
Awesome content. Q1: Won't the worst case time complexity of Merkel Tree Comparision function be O(N), given all nodes are different? Q2: Won't the time complexity of a brute force scan method be O(N^2), since we are doing a cross product b/w 2 table values? TIA!
@jordanhasnolife5163
@jordanhasnolife5163 Ай бұрын
1) Sure, but that's never going to happen in practice for a large database 2) I suppose that depends if they're sorted the same way, which for Cassandra they are! So you could in theory iterate in lockstep
@anshulkatare
@anshulkatare 4 ай бұрын
Hey jordan, Is the video on sequence CRDT missing in the playlist, or not made?
@jordanhasnolife5163
@jordanhasnolife5163 4 ай бұрын
It's in the google docs system design video
@anshulkatare
@anshulkatare 4 ай бұрын
@@jordanhasnolife5163 Awesome, thanks.
@timothyh1965
@timothyh1965 5 ай бұрын
Jordan when you mention snapshot versioning right at the beginning are you talking about vector versioning? Or are you simply referring to how a db may store the previous write along the current write?
@jordanhasnolife5163
@jordanhasnolife5163 5 ай бұрын
Would you mind giving me a timestamp
@timothyh1965
@timothyh1965 5 ай бұрын
@@jordanhasnolife5163 Around 2:12. I think the main idea is that every write has a version number associated with it. In DDIA, they give an example on the leaderless replication chapter (pg 189) between two clients trying to write to a single replica. I think vector versioning (later on, in that same chapter) is this same concept but applied to multiple replicas. Does that make sense?
@jordanhasnolife5163
@jordanhasnolife5163 5 ай бұрын
@@timothyh1965 so yeah in this case basically that number would be a timestamp assigned by whatever node "coordinates" the write. Cassandra can also do version vectors IIRC, but the example I'm showing here is simple "last write wins" resolution.
@timothyh1965
@timothyh1965 5 ай бұрын
@@jordanhasnolife5163 awesome. Thanks man love your videos
@ashoke8031
@ashoke8031 3 ай бұрын
I was expecting Sequence CRDTs next after seeing the previous video 😅. But this one is cool
@ShivangiSingh-wc3gk
@ShivangiSingh-wc3gk 6 ай бұрын
Jordan, how are you learning these concepts? Do you read papers or are you referencing a book?
@jordanhasnolife5163
@jordanhasnolife5163 6 ай бұрын
Both, in this video it's mostly based off DDIA
@chaitanyatanwar8151
@chaitanyatanwar8151 7 ай бұрын
Thanks Jordan!
@sankalpsharma1755
@sankalpsharma1755 7 ай бұрын
Learned about binary search trees in 2016 And i am learning about their real use cases in 2024 :O And yes i'm old :/
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
Database Replication & Sharding Explained
6:53
Hayk Simonyan
Рет қаралды 32 М.
What P vs NP is actually about
17:58
Polylog
Рет қаралды 146 М.
Google system design interview: Design Spotify (with ex-Google EM)
42:13
IGotAnOffer: Engineering
Рет қаралды 1,2 МЛН
How Strong Is Tape?
00:24
Stokes Twins
Рет қаралды 96 МЛН