Tensorum

Replication & Consistency Models

Keeping copies of data on several machines — and deciding what readers are allowed to see.

Distributed SystemsIntermediate7 hrs4 key ideas · 6 applied designs
0%
your progress

Overview

Keeping copies of data on several machines — and deciding what readers are allowed to see.

Key ideas

  • Leader–follower replication is simple and gives a single order of writes; failover is the hard part.
  • Leaderless systems (Dynamo-style) use quorums: with N replicas, W + R > N guarantees overlapping reads and writes.
  • Consistency is a spectrum: linearizable → sequential → causal → read-your-writes → eventual.
  • CRDTs let replicas accept concurrent writes and merge deterministically without coordination.

Trade-offs

  • Synchronous replication protects durability but adds the slowest replica's latency.
  • Stronger consistency costs availability during partitions (CAP) and latency always (PACELC).

In the real world

PostgreSQL streaming replicasCassandra / DynamoDB quorumsRiak and Automerge CRDTs

Keywords

QuorumsRead-your-writesCRDTsAnti-entropy