Consistency Models and the Spectrum
What you'll learn: Consistency isn't just "strong" or "eventual"—it's a nuanced spectrum with many models in between.
Beyond the Binary Choice
The CAP theorem introduced us to consistency vs. availability trade-offs, but treating consistency as binary (you have it or you don't) oversimplifies reality. In distributed systems, consistency exists on a rich spectrum with multiple models offering different guarantees and trade-offs.
The Consistency Spectrum
Think of consistency models like speed limits: strict enforcement (strong consistency) keeps everyone synchronized but slows progress, while looser rules (eventual consistency) allow faster movement but with temporary disagreements about state.
Strong Consistency
At one extreme, linearizability ensures every read sees the most recent write, as if all operations happened on a single machine. This is expensive—requiring coordination across nodes, adding latency.
Middle Ground Models
Between the extremes lie practical compromises:
- Sequential consistency: Operations appear in some total order, but not necessarily real-time order
- Causal consistency: Operations that are causally related are seen in order by all nodes
- Read-your-writes consistency: You always see your own updates, though others might lag
Eventual Consistency
At the other extreme, updates propagate gradually. Given enough time without new writes, all replicas converge to the same state—but in the meantime, different nodes may return different values.
Why This Matters
Different parts of your system may need different consistency levels. A shopping cart might tolerate eventual consistency, while account balances demand something stronger. Understanding the spectrum lets you make granular trade-offs between performance, availability, and correctness rather than applying one-size-fits-all constraints.
Key Takeaway: Consistency is a spectrum with many models between strong and eventual; choosing the right level for each use case optimizes both correctness and performance.