System Design
5. Advanced Database Architecture6. Distributed Systems FundamentalsAnimated
Strong Consistency
Every read sees the latest write.
The idea
The system behaves as if there were a single copy.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- latest
- stale
5 replicas each hold the value v1. We choose W=3 (acks needed to write) and R=3 (replies needed to read).
- N:
- 5
- W:
- 3
- R:
- 3
1/4
Change N, W and R to see when reads can be stale.
Step by step
- 1A write reaches a majority
- 2Reads consult a majority or the leader
- 3They see the latest value
- 4Cost is extra latency
Where it is used
Payments and inventory.
Watch out for
Higher latency and lower availability during partitions.