Senior LevelSystem Design & Architecture
Compare Read Repair versus Active Anti-Entropy (Merkle Trees) in Cassandra.
β Interview Prompt: Compare Read Repair (syncing stale replicas on read) vs Active Anti-Entropy (background Merkle Tree comparison) in Cassandra.
Differentiating data consistency repair mechanisms in distributed databases (Cassandra):
β’
Read Repair: When a client executes a read query, the database compares row digests across replicas. If a replica is stale, a background Read Repair task writes the latest data to the stale replica.
β’
Active Anti-Entropy (AAE): Background process that builds Merkle Trees (cryptographic hash trees) for data ranges and compares them between nodes to detect and repair out-of-sync replicas without scanning raw data!
Code Implementation Example
json
{
"repairMechanism": "Active Anti-Entropy (AAE)",
"dataStructure": "Merkle Tree (Cryptographic Hash Tree)",
"execution": "Background N-to-N Node Sync",
"advantage": "Detects data drift without scanning raw disk records"
}π‘Active Anti-Entropy Merkle Tree repair specification payload.
π― Interview Key Takeaway
Use Read Repair for opportunistic inline syncs, and Active Anti-Entropy Merkle Trees for background data drift repair.
#System Design#Read Repair#Anti-Entropy#Cassandra#Senior
Back to all System Design & Architecture Questionsβ