4 - Leaderless Replication
4 - Leaderless Replication
Types of replication
● Single leader
● Multi leader
● Leaderless
Leaderless Replication Overview
● Any replica can accept a write from a client
● Send reads and writes to all nodes in parallel, once a certain predefined
threshold of nodes return a success value, the client is told that the read/write
was successful
Keeping data up to date
● Anti-Entropy
● Read Repair
Anti Entropy
Background process looks at multiple nodes and their stored values, use version
numbers of the data in order to attempt to make sure that each replica holds the
most up to date copy of the data
Read Repair
Idea: Since we are reading from multiple replicas in parallel, take the most up to
date piece of data and propagate it to the other replicas that had outdated data
W=4
R=4
Quorum illustration
7 database replicas
W=4
R=4
Quorum illustration
7 database replicas
W=4
R=4
Quorums are not perfect
● If we try to write to w nodes to make a quorum, but fewer than w writes
succeed, the client is told that their write failed, but the nodes that did
successfully process the write do not undo it
● If you restore a failed node with an up to date value from one key using a
node with an older value for that key, it will lose the up to date value
● Can still be write conflicts
● Sloppy quorums
Write Conflict Example
DB1 DB2
Me
Angry Ex Girlfriend
Write Conflict Example
DB1 DB2
Angry Ex Girlfriend
Write Conflict Example
DB1 DB2