Consistency models
Linearizable, sequential, causal, eventual — and when each is enough.
A write happened at time t=0. Four clients (A, B, C, D) each want to read the value. When does each client see the new value? That question — not whether they see it, but when — is what a consistency model answers.
The hierarchy
These four aren't options — they're a strict hierarchy. Each weaker model is a superset of the ones stronger than it. Everything linearizable is also sequential, causal, and eventual. Everything causal is also eventual. If a system claims sequential, it also satisfies causal and eventual.
The trap — mixing models
Real production systems rarely use ONE model. They use different models for different data. The URL Shortener journey does this deliberately:
Linearizable data
Billing state (user upgraded to Pro), authentication tokens, deduplication counters. Wrong = data corruption or double-charge.
Eventually consistent data
Click counts, view counters, cache TTLs, cross-region URL visibility. A 1-second window of staleness is fine.
Applied in these systems
- URL Shortener Ch 5.5 — Postgres reads on primary are linearizable; reads on replicas are only sequential (lag).
- URL Shortener Ch 7 — new URL created in us-east-1 is linearizable inside that region, but eventually consistent to eu-west and ap-northeast.
- URL Shortener Ch 10 trade-off matrix — the "Read Consistency" row shows how the model shifts across L4 → L7.
- RAG Ch 6.5 (upcoming) — vector database consistency on inserts vs queries.
References
- Lamport (1979) — "How to Make a Multiprocessor Computer That Correctly Executes Multiprocess Programs." The sequential consistency paper.
- Herlihy & Wing (1990) — "Linearizability: A Correctness Condition for Concurrent Objects." The linearizability paper.
- Ahamad et al. (1995) — "Causal Memory: Definitions, Implementation, and Programming." Causal consistency in distributed shared memory.
- Vogels (2009) — "Eventually Consistent." ACM Queue. The practitioner's introduction.
- Kleppmann (2017) — Designing Data-Intensive Applications, Chapter 9. The canonical reference.
Practice what you just read
Every foundation concept has a companion quiz to close the loop.