16. Amazon Dynamo → DynamoDB — the availability-first key-value store
One-liner. Consistent hashing, quorum reads/writes, and conflict resolution bought shopping-cart availability.
Context. The 2007 Dynamo paper targeted a shopping cart that must accept writes even when a node or data center is unavailable.
Public architecture (Dynamo paper, SOSP 2007).
- Consistent hashing with virtual nodes spreads keys; adding a node moves a fraction of the ring.
- Tunable quorum:
R + W > Nfor strong-ish reads;W=1for always-writable carts. - Vector clocks detect concurrent updates; the application resolves conflicts (merge carts).
- Sloppy quorum + hinted handoff: writes go to the next healthy node, replayed later.
- Merkle trees for anti-entropy between replicas; gossip for membership.
- DynamoDB (the managed successor) kept the partitioning idea but moved to leader-based replication per partition, dropping vector clocks and client-side conflict resolution.
Design lesson. Availability under partition requires accepting conflict; the real decision is who resolves it — the client, a CRDT, or last-writer-wins.
Trade-off. Always-writable means you can read stale or conflicting data; strong reads mean unavailability during partitions.
Trap. "Use a quorum and you get strong consistency" — only when R + W > N and conflict resolution is defined. Do this. Decide the conflict policy before choosing the store.
In Dynamo's model, what do vector clocks provide?
They capture causal history so the client can distinguish "newer" from "concurrent" and merge accordingly.