🔒Key Takeaways
- 1Linearizability: strongest — operations appear instantaneous and globally ordered (as if single copy)
- 2Sequential consistency: operations appear in some consistent total order respecting per-process order
- 3Causal consistency: causally related operations are ordered; concurrent operations may appear in any order
- 4Eventual consistency: weakest but fastest — all replicas converge given sufficient time and no new updates
The Consistency Spectrum
Consistency models define what guarantees a distributed system provides about the order and visibility of operations. Stronger consistency = easier to program against but slower and less available. Weaker consistency = faster but requires application-level handling of anomalies.
Consistency Models Ranked
| Model | Guarantee | Latency | Example Systems |
|---|---|---|---|
| Linearizable | Reads always return latest write globally | Highest (requires coordination) | Spanner, CockroachDB, ZooKeeper |
| Sequential | All processes see same order of operations | High | ZooKeeper (for writes) |
| Causal | Cause → effect ordering is preserved | Medium | MongoDB (causal sessions) |
| Read-your-writes | You always see your own writes | Medium | Most web apps (session-based) |
| Eventual | Replicas converge eventually | Lowest | DynamoDB, Cassandra, DNS |
✅Practical Advice
Most applications need linearizability only for critical operations (payments, inventory) and can use eventual consistency for everything else (user profiles, activity feeds, analytics). Design per-operation, not per-system.
Advantages
- •Strong models simplify application logic
- •Weak models enable highest performance
- •Per-operation consistency lets you optimize intelligently
Disadvantages
- •Strong consistency always costs latency
- •Eventual consistency creates anomalies developers must handle
- •Choosing the wrong model causes either performance or correctness issues
🧪 Test Your Understanding
Knowledge Check1/1
Which consistency model is 'cheapest' (lowest latency)?