Eventual consistency
A guarantee that, if no new updates occur, all replicas eventually converge to the same value. Reads may be stale in the meantime. The default for highly-available, globally-distributed systems. Trades immediate consistency for availability and latency.
- Globally-distributed reads, social feeds, shopping carts.
- When availability and low latency beat immediate consistency.
- Financial balances, inventory, anything where stale reads cause errors.
- When developers can't handle divergence.
Definition
Eventual consistency says replicas will agree given enough time and no new writes, but offers no bound on when. Variants add guarantees: read-your-writes, monotonic reads, session consistency. Common in Dynamo-style and CDN-cached systems.
Why it exists
Strong consistency across a globally-distributed system adds latency (quorum round trips) and reduces availability during partitions. Eventual consistency lets each region serve reads locally and fast, accepting temporary divergence.
How it works
Writes go to one or a few replicas; anti-entropy (gossip, read repair, CDC) propagates them. Conflict resolution is last-writer-wins, app-defined, or CRDTs. Session tokens pin a user to a replica for read-your-writes.
Scaling limits
No bound on staleness without stronger models. Conflict resolution can lose concurrent updates. Users may see their own writes 'disappear' without read-your-writes. Hard to reason about for developers.
Cost shape
Cheap reads (local replica) and high availability. The cost is staleness and conflict-handling complexity.
Alternatives
- Strong/linearizable consistency — Correct but slower and less available.
- Causal consistency — Preserves causality without global linearizability.
Failure modes
- Stale reads causing user confusion.
- Concurrent-write conflicts lost by LWW.
- Unbounded convergence time.