Friday, October 14, 2011

Dynamo: Amazon's Highly Available Key-Value Store

Dynamo is a high-availability distributed key-value store developed by Amazon. The main problem that they were trying to solve was having a key-value store that is always writeable, at the expense of some consistency under certain failure scenarios. Making the system always writeable was a priority for Amazon, since many of their user-facing applications (e.g. shopping cart) need to be able to receive input from users, while read operations take lower priority (i.e. doesn't affect their business as much).

Amazon services have stringent latency requirements (in the 99.9th percentile) since, interestingly, often the users with the longest histories (and hence the most loyal customers) take the most resources to process.  Dynamo scales and maintains high availability by using consistent hashing for partitioning and replication of data, with consistency facilitated by object versioning. Consistency among replicas during updates is maintained by quorums and decentralized replica synchronization. Also important is that Dynamo can scale incrementally (one host at a time with minimal impact), has symmetry (each node has the same responsibilities), decentralization and heterogeneity (servers with different specifications can take on corresponding workloads).

The interface to Dynamo is simple -- just get() and put() operations. Incremental scalability relies on consistent hashing via a "ring" so that addition/removal of nodes only affects immediate neighbors. Nodes are mapped to several spots on the ring to ensure consistent load distribution.

So far, it looks like Amazon has had excellent results with Dynamo, with 99.9995% of requests successful and no data loss as of the paper's publication. This, coupled with the several Dynamo-inspired open source implementations (Voldemort, Cassandra, Riak, etc.), suggests that this model will be influential over the next decade at least. There is certainly room for key-value stores that have high write availability, especially in business applications and social networking. The main tradeoffs with Dynamo are consistency (it guarantees the A & P of the CAP theorem) and, possibly, the fact that it is *too* configurable (can be hard to tune).

No comments:

Post a Comment