Course contentsShow
← System Design
Lesson 377 of 1,91910. NoSQL: Key-Value StoresFree lesson

Eventual Consistency and Application Reconciliation

How Dynamo embraces eventual consistency and pushes conflict resolution logic to application code.

Eventual Consistency and Application Reconciliation

What you'll learn: How Dynamo embraces eventual consistency and pushes conflict resolution logic to application code.

The Core Idea

In Dynamo's design, eventual consistency means that after a write, not all replicas are immediately synchronized—different nodes may temporarily hold different versions of the same data. Instead of the database forcing a single "correct" value, Dynamo returns all conflicting versions to the application and lets your code decide how to merge them.

This is the trade-off for high availability: the system stays online and responsive even during network partitions, but you must handle reconciliation yourself.

Why Push Reconciliation to Applications?

Dynamo can't always know which version is "right." Imagine a shopping cart: if two devices add different items while disconnected, both changes are valid. The database detects this conflict using vector clocks (from lesson 374) and returns both cart states. Your application must merge them—perhaps by combining items from both carts rather than picking one and discarding the other.

The Application's Responsibility

When reading data, your application receives:

  • All sibling versions (conflicting values)
  • Their vector clock metadata

Your code must:

  1. Detect that multiple versions exist
  2. Reconcile them using domain-specific logic (merge, pick latest timestamp, keep both, etc.)
  3. Write back the resolved version, which becomes the new authoritative state

The Trade-Off

You gain availability and partition tolerance (from CAP theorem context), but you lose automatic consistency guarantees. The complexity moves from infrastructure to your codebase.

Key Takeaway: Dynamo's eventual consistency model sacrifices automatic conflict resolution for availability, requiring applications to implement custom reconciliation logic when reading conflicting data versions.