Anti-Entropy with Merkle Trees
Amazon Dynamo's synchronization between replicas:
- Each replica maintains a Merkle tree over its keyspace
- To sync replica A and B: compare root hashes
- If equal → in sync (no I/O needed)
- If different → recurse into left and right subtrees
- Find the differing leaf → sync only those keys
Efficiency: O(log n) messages to identify differences in n key-value pairs, rather than comparing all keys.
Used by: Dynamo, Cassandra (repair mechanism), Riak