CS PAPERS DEEP-READ · PAPER 54

Dynamo: Amazon's Highly Available Key-value Store

DeCandia et al. · Amazon · SOSP 2007

中文 →

What did this paper do?

In 2007, Amazon published the design of its internal storage system, Dynamo. It powers things like the shopping cart: during a Black Friday rush, with machines failing in the datacenter and the network occasionally hiccupping, when you add an item to your cart, that write must never fail. The whole paper answers one question: how do you build storage that is "always writeable"?

It made a trade nobody else dared to

Traditional databases live by one rule: data must be consistent at all times—everyone always sees the same latest value. To hold that line, when a failure or network split hits, they would rather refuse service than let the data diverge. Dynamo bets the other way: it would rather let data diverge briefly than turn a user away. For a shopping cart, "add-to-cart failed" is far worse than "the cart briefly holds an extra item we'll reconcile later."

Which machine holds the data? — a round table

With thousands of machines, which one stores a given key (say, a user's cart)? Dynamo imagines all machines seated around a round table, each holding a seat number. It hashes the key to a number, and the first machine you reach walking around the table is responsible for it—plus the next two, for three copies. The beauty: adding or removing one machine only affects its two neighbors; almost all other data stays put. Scaling up or down needs no big migration.

What if a machine dies? — let a neighbor sign for it

What if the machine you meant to write to is down? Dynamo doesn't wait—it hands the data to the next live neighbor around the table to "sign for it," attached with a note saying "this really belongs to Machine X." When the original recovers, the neighbor delivers the held data plus the note back. So writes almost always land somewhere.

And if versions diverge?

If the same cart got edited on two machines, you now have two versions. Dynamo won't silently pick a winner for you—it keeps both, and hands them over together the next time someone reads, letting the application merge them. The cart's merge rule is simple: take the union—keep everything either side added (an extra item is better than a lost one). The cost is honest: the app must write this "what to do with two versions" logic itself, rather than leaving it all to the database.

Remember it in one line

To stay "always writeable," Dynamo deliberately gives up "always consistent": a round-table scheme decides where data lives so scaling needs no big migration, a dead machine's writes are signed for by a neighbor, and divergent versions coexist and get merged by the app at read time. This "eventual consistency" playbook ignited a whole generation of NoSQL databases—Cassandra, Riak, DynamoDB, and more.

Want the consistent-hashing ring, vector clocks, and the R+W quorum mechanics? → switch to the deep read