Skip to content
StackDecode
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.

node 1value v1node 2value v1node 3value v1node 4value v1node 5value v1
  • 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

  1. 1A write reaches a majority
  2. 2Reads consult a majority or the leader
  3. 3They see the latest value
  4. 4Cost is extra latency

Where it is used

Payments and inventory.

Watch out for

Higher latency and lower availability during partitions.

Related