Eventual Consistency
Eventual consistency is a consistency model used in distributed systems that guarantees that, if no new updates are made to a data item, all replicas will eventually converge to the same value — but does not guarantee when.
Eventual consistency is a consistency model used in distributed systems that guarantees that, if no new updates are made to a data item, all replicas will eventually converge to the same value — but does not guarantee when.
This diagram shows the state of a distributed system across three nodes after a write is applied to Node A. Immediately after the write, Node A holds the new value v2 while Nodes B and C still hold the stale value v1. A client reading from Node B at this moment will receive the old value — this is called a stale read. As the replication mechanism propagates the change, Node B receives and applies the update, then Node C follows. Once all nodes have applied the update, the system is in a converged state where every node returns v2.
The time window between the initial write and full convergence is the inconsistency window. Its duration depends on replication topology, network latency, node load, and the anti-entropy protocol (gossip, log shipping, CRDTs). Systems like DynamoDB, Cassandra, and Riak are built around eventual consistency, trading strong consistency for high availability and partition tolerance as described by the CAP Theorem Model.
Applications built on eventually consistent stores must tolerate stale reads. Common strategies include read-your-writes consistency (routing a user's reads to the same node that accepted their write), monotonic read consistency (ensuring a client never observes a regression to an older value), and last-write-wins conflict resolution using vector clocks or timestamps.
For developers, the most common encounter with eventual consistency is replication lag in Database Replication setups. An asynchronous replica can be seconds or minutes behind the primary. The Primary Replica Sync diagram shows where that lag originates in the replication protocol.