Skip to content
The Dynamo Paper: How Amazon Built a Database That Never Goes Down 12 min

The Dynamo Paper: How Amazon Built a Database That Never Goes Down

SD
ScaleDojo
May 23, 2026
12 min read2,408 words
The Dynamo Paper: How Amazon Built a Database That Never Goes Down

Amazon's Oracle Problem

In 2004, Amazon's CTO Werner Vogels published a frank admission: their monolithic Oracle database was killing them. Every Black Friday, the single shared database became the bottleneck for the entire company. Teams could not deploy independently because schema changes required coordination with every other team. A bug in one service could degrade the database for every service sharing it. Scaling reads meant adding expensive Oracle RAC licenses. The licensing costs alone were astronomical.

Amazon's solution was to break the monolith into services, each owning its own data store. This was not microservices in the modern sense (that term would not exist for years) but the motivation was identical: eliminate the shared database coupling that was making the entire platform fragile. The lesson was painful and expensive to learn, but it became the founding principle of service-oriented architecture.

A shared database is hidden coupling between services. The moment two services read from the same table, they are coupled, even if their code never imports each other. Data ownership is the hardest part of service decomposition.

The Dynamo Paper (2007)

Amazon published the Dynamo paper at SOSP 2007 and it immediately became required reading for anyone building distributed systems. The problem Dynamo solved was specific: Amazon's shopping cart must always be writable. Even during partial network failures, even during data center outages, a customer must be able to add items to their cart. Refusing a write because a replica is unreachable is unacceptable. Lost revenue and bad user experience.

Dynamo built an 'always-writeable' key-value store by accepting that consistency was a trade-off worth making. If two nodes accept conflicting writes during a partition, reconcile them later. Use conflict detection (vector clocks) to identify which writes conflict and either resolve them automatically or surface them to the application for manual reconciliation. The shopping cart use case was tolerant of this: two carts that got merged just show all the items from both sessions.

The Technical Innovations

Dynamo assembled several distributed systems techniques into a coherent whole. Each technique solves a specific problem:

  • Consistent hashing: assigns each key to a node on a virtual ring. When nodes join or leave, only the keys on the affected range need to be redistributed. This prevents the 'reshuffling everything' problem of naive modulo-based partitioning.

  • Sloppy quorums: instead of requiring a strict majority of replicas to confirm a write, Dynamo uses any N available nodes. This keeps writes available even when the 'correct' replica nodes are down.

  • Hinted handoff: if the intended replica is unavailable, a different node temporarily holds the write with a hint about where to send it when the original recovers. Writes never get lost.

  • Vector clocks: each write carries a version vector that records which node made the change and when. This lets Dynamo detect conflicts (two writes to the same key that diverged) and surface them for resolution.

  • Tunable consistency: read and write quorum sizes are configurable. R + W > N gives strong consistency. Lower values give higher availability at the cost of potential staleness.

Why This Paper Matters for Every Distributed Database Interview

The Dynamo paper is the single most important paper for system design interviews involving databases. Consistent hashing shows up in cache partitioning questions. Quorum reads and writes show up in replication questions. Vector clocks show up in conflict resolution questions. The vocabulary Dynamo introduced (eventual consistency, tunable consistency, sloppy quorum) is now standard interview language.

Cassandra was directly inspired by Dynamo's partitioning model. Riak implemented Dynamo's architecture almost verbatim. DynamoDB (Amazon's managed service) uses the same concepts. Every eventually consistent database in production today traces back to the ideas in this paper.

Further Reading

  • DeCandia et al. (2007): 'Dynamo: Amazon's Highly Available Key-Value Store', all of the techniques above explained in detail

  • Werner Vogels' blog (allthingsdistributed.com) for Amazon's ongoing distributed systems thinking

  • Martin Kleppmann's 'Designing Data-Intensive Applications', Chapters 5-7 on replication, partitioning, and transactions

Consistent Hashing with Virtual Nodes: How Rebalancing Becomes Painless

Naive hash-based partitioning (key mod N) has a fatal flaw: when N changes (a node joins or leaves), almost every key must move. If 50% of keys move during a node addition, the cache hit rate collapses and the database gets hammered during exactly the moment when the cluster is under stress. Consistent hashing solves this by imagining nodes and keys placed on a ring (hash values 0 to 2^32 - 1). Each key is served by the first node clockwise from its hash. When a node is added, it only takes keys from its immediate clockwise neighbor. N changes, but only 1/N of keys move.

Virtual nodes (vnodes) solve the hot-spot problem that pure consistent hashing creates. With one position per physical node, load is unevenly distributed (lucky nodes get large key ranges, unlucky ones get small ones). Virtual nodes assign each physical node to 100 to 200 positions on the ring. The key range each server owns is the union of many small segments spread across the ring. Load distributes far more evenly, and when a node fails, its load spreads across many nodes instead of dumping onto one.

  • With consistent hashing: adding a node moves 1/N keys on average. Without it: moves up to (N-1)/N keys.

  • Virtual nodes: each physical node owns multiple ring positions. More positions = more even distribution.

  • Replication: each key is replicated to the next N nodes clockwise on the ring (N is the replication factor).

  • Preference list: the ordered list of nodes responsible for a key. Dynamo routes to the first N healthy nodes.

  • Data center awareness: Dynamo places replicas across data centers for fault tolerance. Virtual nodes simplify this topology constraint.

Vector Clocks in Practice: Tracking Concurrent Writes

A vector clock is a list of (node, counter) pairs, one entry per node that has modified a value. Every write increments the writing node's counter. When two versions of a value are compared, if every counter in version A is less than or equal to the corresponding counter in version B, then B is definitively newer. If neither vector subsumes the other (some counters higher in A, some higher in B), the two versions are concurrent and conflict. Dynamo surfaces conflicting versions to the application. The shopping cart application merges them by taking the union of all items. Different applications define their own merge strategies.

  • Version A [node1:2, node2:1] vs version B [node1:2, node2:2]: B is newer. A happened-before B.

  • Version A [node1:3, node2:1] vs version B [node1:2, node2:2]: concurrent. Neither dominates. Conflict.

  • Conflict resolution strategies: last-write-wins (loses data), application-merge (correct but complex), CRDT (automatic convergence).

  • Clock truncation: Dynamo truncates old (node, counter) entries to bound clock size. Can cause false conflict resolution.

  • DynamoDB chose not to expose vector clocks to simplify the API, using conditional writes (optimistic locking) instead.

What Interviewers Test About Dynamo's Architecture

Dynamo is the canonical reference for eventual consistency, tunable consistency, and key-value store design. Interview questions about DynamoDB, Cassandra, or any key-value store are really questions about Dynamo's ideas. The ability to trace a design choice (quorum reads, consistent hashing, conflict resolution) back to the original motivation (always-writable cart, no SPOF, auto-reconciliation) demonstrates systems thinking depth.

  • Know: what R+W>N gives you and why R=W=1 is dangerous (fast but no consistency guarantee)

  • Know: the performance profile of quorum reads vs quorum writes vs single-node operations

  • Know: why sloppy quorums improve availability and what 'hinted handoff' does during node failures

  • Know: the difference between an always-writeable design (AP) and a coordination-based design (CP)

  • Know: when last-writer-wins is acceptable (user preferences) vs when it is catastrophic (account balance)

Consistent Hashing with Virtual Nodes: How Rebalancing Becomes Painless

Naive hash-based partitioning (key mod N) has a fatal flaw: when N changes (a node joins or leaves), almost every key must move. If 50% of keys move during a node addition, the cache hit rate collapses and the database gets hammered during exactly the moment when the cluster is under stress. Consistent hashing solves this by imagining nodes and keys placed on a ring (hash values 0 to 2^32 - 1). Each key is served by the first node clockwise from its hash. When a node is added, it only takes keys from its immediate clockwise neighbor. N changes, but only 1/N of keys move.

Virtual nodes (vnodes) solve the hot-spot problem that pure consistent hashing creates. With one position per physical node, load is unevenly distributed (lucky nodes get large key ranges, unlucky ones get small ones). Virtual nodes assign each physical node to 100 to 200 positions on the ring. The key range each server owns is the union of many small segments spread across the ring. Load distributes far more evenly, and when a node fails, its load spreads across many nodes instead of dumping onto one.

  • With consistent hashing: adding a node moves 1/N keys on average. Without it: moves up to (N-1)/N keys.

  • Virtual nodes: each physical node owns multiple ring positions. More positions = more even distribution.

  • Replication: each key is replicated to the next N nodes clockwise on the ring (N is the replication factor).

  • Preference list: the ordered list of nodes responsible for a key. Dynamo routes to the first N healthy nodes.

  • Data center awareness: Dynamo places replicas across data centers for fault tolerance. Virtual nodes simplify this topology constraint.

Vector Clocks in Practice: Tracking Concurrent Writes

A vector clock is a list of (node, counter) pairs, one entry per node that has modified a value. Every write increments the writing node's counter. When two versions of a value are compared, if every counter in version A is less than or equal to the corresponding counter in version B, then B is definitively newer. If neither vector subsumes the other (some counters higher in A, some higher in B), the two versions are concurrent and conflict. Dynamo surfaces conflicting versions to the application. The shopping cart application merges them by taking the union of all items. Different applications define their own merge strategies.

  • Version A [node1:2, node2:1] vs version B [node1:2, node2:2]: B is newer. A happened-before B.

  • Version A [node1:3, node2:1] vs version B [node1:2, node2:2]: concurrent. Neither dominates. Conflict.

  • Conflict resolution strategies: last-write-wins (loses data), application-merge (correct but complex), CRDT (automatic convergence).

  • Clock truncation: Dynamo truncates old (node, counter) entries to bound clock size. Can cause false conflict resolution.

  • DynamoDB chose not to expose vector clocks to simplify the API, using conditional writes (optimistic locking) instead.

What Interviewers Test About Dynamo's Architecture

Dynamo is the canonical reference for eventual consistency, tunable consistency, and key-value store design. Interview questions about DynamoDB, Cassandra, or any key-value store are really questions about Dynamo's ideas. The ability to trace a design choice (quorum reads, consistent hashing, conflict resolution) back to the original motivation (always-writable cart, no SPOF, auto-reconciliation) demonstrates systems thinking depth.

  • Know: what R+W>N gives you and why R=W=1 is dangerous (fast but no consistency guarantee)

  • Know: the performance profile of quorum reads vs quorum writes vs single-node operations

  • Know: why sloppy quorums improve availability and what 'hinted handoff' does during node failures

  • Know: the difference between an always-writeable design (AP) and a coordination-based design (CP)

  • Know: when last-writer-wins is acceptable (user preferences) vs when it is catastrophic (account balance)

Consistent Hashing with Virtual Nodes: How Rebalancing Becomes Painless

Naive hash-based partitioning (key mod N) has a fatal flaw: when N changes (a node joins or leaves), almost every key must move. If 50% of keys move during a node addition, the cache hit rate collapses and the database gets hammered during exactly the moment when the cluster is under stress. Consistent hashing solves this by imagining nodes and keys placed on a ring (hash values 0 to 2^32 - 1). Each key is served by the first node clockwise from its hash. When a node is added, it only takes keys from its immediate clockwise neighbor. N changes, but only 1/N of keys move.

Virtual nodes (vnodes) solve the hot-spot problem that pure consistent hashing creates. With one position per physical node, load is unevenly distributed (lucky nodes get large key ranges, unlucky ones get small ones). Virtual nodes assign each physical node to 100 to 200 positions on the ring. The key range each server owns is the union of many small segments spread across the ring. Load distributes far more evenly, and when a node fails, its load spreads across many nodes instead of dumping onto one.

  • With consistent hashing: adding a node moves 1/N keys on average. Without it: moves up to (N-1)/N keys.
  • Virtual nodes: each physical node owns multiple ring positions. More positions = more even distribution.
  • Replication: each key is replicated to the next N nodes clockwise on the ring (N is the replication factor).
  • Preference list: the ordered list of nodes responsible for a key. Dynamo routes to the first N healthy nodes.
  • Data center awareness: Dynamo places replicas across data centers for fault tolerance. Virtual nodes simplify this topology constraint.

Vector Clocks in Practice: Tracking Concurrent Writes

A vector clock is a list of (node, counter) pairs, one entry per node that has modified a value. Every write increments the writing node's counter. When two versions of a value are compared, if every counter in version A is less than or equal to the corresponding counter in version B, then B is definitively newer. If neither vector subsumes the other (some counters higher in A, some higher in B), the two versions are concurrent and conflict. Dynamo surfaces conflicting versions to the application. The shopping cart application merges them by taking the union of all items. Different applications define their own merge strategies.

  • Version A [node1:2, node2:1] vs version B [node1:2, node2:2]: B is newer. A happened-before B.
  • Version A [node1:3, node2:1] vs version B [node1:2, node2:2]: concurrent. Neither dominates. Conflict.
  • Conflict resolution strategies: last-write-wins (loses data), application-merge (correct but complex), CRDT (automatic convergence).
  • Clock truncation: Dynamo truncates old (node, counter) entries to bound clock size. Can cause false conflict resolution.
  • DynamoDB chose not to expose vector clocks to simplify the API, using conditional writes (optimistic locking) instead.

What Interviewers Test About Dynamo's Architecture

Dynamo is the canonical reference for eventual consistency, tunable consistency, and key-value store design. Interview questions about DynamoDB, Cassandra, or any key-value store are really questions about Dynamo's ideas. The ability to trace a design choice (quorum reads, consistent hashing, conflict resolution) back to the original motivation (always-writable cart, no SPOF, auto-reconciliation) demonstrates systems thinking depth.

  • Know: what R+W>N gives you and why R=W=1 is dangerous (fast but no consistency guarantee)
  • Know: the performance profile of quorum reads vs quorum writes vs single-node operations
  • Know: why sloppy quorums improve availability and what 'hinted handoff' does during node failures
  • Know: the difference between an always-writeable design (AP) and a coordination-based design (CP)
  • Know: when last-writer-wins is acceptable (user preferences) vs when it is catastrophic (account balance)

Enjoyed this article?

Share it with your network to help others level up their system design skills.

Discussion0

Join the Discussion

Sign in to leave comments, reply to others, or like insights.

Sign In to ScaleDojo

No comments yet. Be the first to start the thread!

Related Articles

Enjoyed this content?

Your support keeps us creating free resources

We put a lot of hours into researching and writing these guides. If it helped you, consider buying us a coffee. Every bit goes toward keeping ScaleDojo's content free and growing.

$

One-time payment via Stripe. ScaleDojo account required.

ScaleDojo Logo
Initializing ScaleDojo