Skip to content
StackDecode
System Design
5. Advanced Database ArchitectureAnimated

Anti-Entropy Repair

Background process that syncs replicas.

The idea

Replicas compare Merkle tree hashes and copy only the differing ranges.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

Replica AReplica Broot hash of my Merkle tree
  • current message
  • earlier
  • failure or attack

Replicas compare a single hash of their whole key range.

step:
1/6
from:
Replica A
to:
Replica B
1/6

Time runs downward. Solid arrows are requests, dashed arrows are replies.

Step by step

  1. 1Build Merkle trees of data
  2. 2Compare roots
  3. 3Descend where hashes differ
  4. 4Copy the missing data

Where it is used

Keeping replicas aligned.

Watch out for

Heavy I/O if run too often.

Related