Replication & Quorums
Lesson, slides, and applied problem sets.
View SlidesLesson
Replication & Quorums
Why replication matters
Replication gives you availability and durability, but only if reads and writes agree on which replicas matter. Quorums are the core mechanism for that agreement.
Quorums in one sentence
A quorum is a subset of replicas big enough that any two quorums overlap. That overlap is where you enforce consistency.
The two rules to memorize
With replication factor N, read quorum R, write quorum W:
- Read/Write intersection:
R + W > N - Write/Write intersection:
W + W > N(equivalentlyW > N/2)
These tell you whether reads can see the latest write and whether two writes can conflict.
Practical mechanics
- Read repair: read from R, return latest, fix stale replicas in the background.
- Hinted handoff: if a replica is down, write to a fallback node with a hint for the intended replica.
What you will build
- Quorum safety checks
- Read-repair merge + repair set
- Hinted-handoff target selection
- Quorum read plan (value + repair + safety)