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.
- 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
- 1Read from several replicas
- 2Compare versions
- 3Return the newest
- 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.