Amazon Dynamo and the Shopping Cart Merge Test

I still use Dynamo's shopping cart to explain a clear storage trade: preserve a customer's additions even when reconciling conflicting versions brings a deleted item back.
Amazon's 2007 SOSP paper is packed with consistent hashing, sloppy quorums, and anti-entropy trees, yet that product-level bargain is the detail worth keeping in every architecture review. Somebody decided up front which wrong answer the business could afford.
A pair of socks returns
Start with a cart holding one pair of socks. Two clients read that version before seeing each other's writes. Client one deletes the socks. Client two adds a book to the snapshot it read, which still includes the socks.
Now one replica branch holds an empty cart while the concurrent branch holds socks plus a book. A set-union merge keeps every item present on either branch and returns socks plus the book. Customer additions survive, and the deletion disappears.
In Dynamo's vector-clock model, neither [A:2] nor [A:1, B:1] dominates the other, so a read receives both concurrent cart siblings and reconciles them by set union:
{
"base_version": { "clock": { "A": 1 }, "items": ["socks"] },
"concurrent_siblings": [
{ "version": "v1", "clock": { "A": 2 }, "items": [] },
{ "version": "v2", "clock": { "A": 1, "B": 1 }, "items": ["socks", "book"] }
],
"set_union_reconciled": { "items": ["socks", "book"] }
}
Inspecting two item sets alone cannot recover intent without causal delete markers or operation logs. Treating reconciliation as set union is an explicit business policy with a customer-visible failure mode.
That is the cart test. Write down two concurrent write histories, run the proposed merge function by hand, and state the outcome in plain product terms. Saying "replicas eventually converge" hides the defect. Saying "a removed item can reappear at checkout" gives a product leader a real decision to sign off on.
Vector clocks and business intent
Dynamo tracks causal history with vector clocks. Superseded versions drop automatically, while concurrent branches surface multiple siblings for read-time reconciliation. Sloppy quorums and hinted handoff let healthy fallback nodes accept writes during partitions, widening availability without making storage infallible. Where Google Bigtable routes all mutations for a row range through one tablet server to preserve single-row atomicity, Dynamo accepts concurrent divergent writes during network splits and pushes conflict resolution up to the caller.
Giving applications control over conflict resolution also hands them responsibility for domain semantics. Bringing back a deleted book in a retail cart is annoying. Bringing back a revoked privacy consent or a canceled transfer is a compliance incident.
Even inventory does not reduce to a slogan against eventual consistency. A platform can pre-allocate bounded stock quotas across regions and sell locally within each quota. What fails is letting two partitioned writers promise the exact same final unit with no prior reservation and expecting a background merge to honor both commitments.
The second customer on call
Werner Vogels added the operational postscript five years later. Although Dynamo hit its latency and availability targets for core retail workloads (with 99.94% of cart reads seeing a single version over 24 hours), broader internal adoption stalled because product teams had to operate and tune their own clusters. DynamoDB emerged as a managed redesign rather than the 2007 software repackaged.
Every high-availability data store serves two constituencies: the shopper clicking add-to-cart and the engineer paged when sibling versions pile up. When teams propose an always-writable store today, which merge anomaly do they usually underestimate first?
Sources
- DeCandia et al., Dynamo: Amazon's Highly Available Key-value Store, SOSP 2007.
- Werner Vogels, Amazon DynamoDB, January 2012.
Continue in Paper Reviews
A Tighter Bound, More Mistakes
In Lamb, Torr, and Rudner's November 2026 paper on LLM judges, what caught my attention is that the tightest statistical bound comes from an adapter making…
SGLang RadixAttention: Put the Prompt Timestamp Last
Giving a language model the current timestamp is reasonable. Putting that changing timestamp on line one of a long system prompt is expensive. That is the…