Skip to content
StackDecode
System Design
5. Advanced Database ArchitectureAnimated

Read Repair

Fix stale replicas when a read notices them.

The idea

During a quorum read, if replicas disagree, the coordinator writes the newest value back to stale ones.

Watch it work

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

ClientReplica 1Replica 2Replica 3read key (v=5)
  • current message
  • earlier
  • failure or attack

The coordinator asks several replicas.

step:
1/6
from:
Client
to:
Replica 1
1/6

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

Step by step

  1. 1Read from several replicas
  2. 2Compare versions
  3. 3Return the newest
  4. 4Push it to stale replicas

Where it is used

Dynamo-style stores.

Watch out for

Rarely read keys stay stale, so anti-entropy is also needed.

Related