What is eventual consistency?

Eventual consistency is a guarantee that if no new updates are made, every copy of a piece of data will converge to the same value. Until then, different readers may briefly see older values.

Also called eventually consistent, eventual consistency modelUpdated

A system is eventually consistent when an update doesn't reach every copy of the data at once, but all copies converge to the same value if no new updates arrive. During the gap, called the inconsistency window, two readers can see different answers. Werner Vogels of Amazon set out this definition in his 2008 article "Eventually Consistent". It guarantees convergence, not speed.

Consistency here means copies agreeing with each other. That is different from the C in ACID, which means a transaction leaves the database valid under its rules.

Where you meet it

  • Read replicas. A primary database replicates to read replicas asynchronously. Write to the primary, read from a replica a few milliseconds later, and you may get the old row.
  • NoSQL databases. DynamoDB reads are eventually consistent by default. Setting ConsistentRead to true gives a strongly consistent read on tables and local secondary indexes, at twice the read cost. Reads from global secondary indexes are always eventually consistent.
  • Microservices. When the order service publishes an event and the loyalty service updates points from it, the two databases disagree until the event is processed. Communication between services in an event-driven architecture is eventually consistent by design.
  • Caches, search indexes and DNS. All of them lag behind the source of truth.

Example: a wallet top-up and its balance screen

A user adds ₹1,000 to a wallet. The payments service commits the ledger entry and publishes WalletCredited through a transactional outbox. A separate read model that powers the balance screen processes the event about 300 ms later.

Time Ledger (source of truth) Balance read model
t0 ₹2,000 ₹2,000
t0 + 50 ms, credit committed ₹3,000 ₹2,000
t0 + 350 ms, event processed ₹3,000 ₹3,000

If the app refreshes at t0 + 100 ms, the user sees ₹2,000 and may think the top-up failed. Two common fixes: show the new balance returned in the top-up response, or read from the ledger for a user who has just written. Decisions such as "is there enough balance to pay?" must read from the ledger, never from the lagging copy. This split between a write model and read models is the core of CQRS.

Eventual vs strong consistency

With strong consistency, once a write completes, every later read returns it. You pay in latency, because the write waits for replicas, and in availability when the network between nodes fails. That trade-off is the CAP theorem.

Vogels also gives the quorum rule. With N copies, W copies that must acknowledge a write and R copies read, W + R > N means every read overlaps the latest write, so reads are consistent. N = 3, W = 2, R = 2 meets the rule. N = 3, W = 1, R = 1 is eventually consistent.

Two weaker guarantees are often enough and cheaper:

  • Read-your-writes: a user always sees their own updates.
  • Monotonic reads: once a user has seen a value, they never see an older one.

When it's acceptable

Eventual consistency suits feeds, notifications, analytics, search results and counters, where a short delay is harmless. Avoid it for balances, stock reservations, seat bookings and anything with a uniqueness rule. Where you must use it, add a strongly consistent check at the moment of decision. Our DynamoDB vs PostgreSQL comparison helps decide which database fits each part of a system.

Any idea in mind? Let's make it real.

Tell us what you're building. You'll hear back from an engineer, not a sales team, usually within one working day.

Book a 30-min call