Course contentsShow
← System Design
Lesson 370 of 1,91910. NoSQL: Key-Value StoresFree lesson

Distributed Key-Value Store Architectures in Practice

Comparing architectures like Amazon Dynamo, Riak, and Cassandra's wide-column variant as KV stores.

Distributed Key-Value Store Architectures in Practice

What you'll learn: How real-world systems like Amazon Dynamo, Riak, and Cassandra implement distributed key-value store principles differently.

Now that you understand the theoretical building blocks—consistent hashing, quorum replication, vector clocks, and anti-entropy—let's see how actual systems combine these pieces.

Amazon Dynamo (AWS DynamoDB)

Amazon's Dynamo paper pioneered many distributed KV concepts. It uses consistent hashing with virtual nodes, tunable consistency via quorum reads/writes (R and W parameters), vector clocks for conflict detection, and Merkle trees for efficient anti-entropy. Writes succeed even during network partitions using sloppy quorums and hinted handoff. DynamoDB prioritizes availability and partition tolerance (AP in CAP).

Riak

Riak closely follows Dynamo's architecture. It emphasizes multi-datacenter replication, provides tunable consistency knobs, and uses vector clocks (or dotted version vectors in newer versions) for conflict resolution. Riak lets applications handle conflicts explicitly through callbacks, giving developers control over merge logic. Like Dynamo, it favors availability.

Cassandra (Wide-Column Variant)

While technically a wide-column store, Cassandra shares core KV architecture: consistent hashing with virtual nodes, tunable consistency (ONE, QUORUM, ALL), and configurable replication strategies. However, Cassandra differs by using last-write-wins with timestamps instead of vector clocks, making conflict resolution automatic but potentially lossy. It also supports richer data models than pure key-value.

Architectural Trade-offs

All three prioritize horizontal scalability and high availability. Dynamo and Riak handle conflicts more carefully but require application logic. Cassandra simplifies operations with timestamp-based resolution but may silently lose updates during concurrent writes. Your choice depends on whether you need strong conflict detection or operational simplicity.

Key Takeaway: Real distributed KV stores combine consistent hashing, replication, and anti-entropy differently—Dynamo/Riak favor explicit conflict handling for correctness, while Cassandra chooses automatic resolution for simplicity.