Eventual Consistency

Eventual consistency is the property that, given enough time without new updates, all replicas of a piece of data will converge to the same value. Reads may see stale or out-of-order data in the short term, but the system guarantees convergence rather than instantaneous global agreement.

Why it exists

Strong consistency (every read sees the latest write) requires coordination on every write, which costs latency and reduces availability under network partitions. Eventual consistency relaxes that requirement, trading temporary disagreement for higher throughput, lower latency, and resilience to partitions. Almost every globally distributed system is eventually consistent at some layer.

Common implementations

  • Asynchronous replication. Primary accepts writes, replicas catch up later (PostgreSQL streaming replication, MySQL binlog).
  • Multi-leader / leaderless. Any node accepts writes; replicas reconcile in the background (DynamoDB, Cassandra, Riak).
  • CRDTs (Conflict-free Replicated Data Types). Data structures designed so concurrent updates converge automatically (used in collaborative editing).
  • Gossip protocols. Nodes periodically exchange state with random peers until everyone agrees.

Strengthening reads when needed

  • Read-after-write. Route reads to a replica that has already applied the user's own recent writes.
  • Bounded staleness. Guarantee replicas are no more than N seconds behind.
  • Linearizable reads on demand. Pay the cost only when a specific operation needs the latest value.
🔗

Subscribe to Sahil's Playbook

Clear thinking on product, engineering, and building at scale. No noise. One email when there's something worth sharing.
[email protected]
Subscribe
Mastodon