Back to roadmap
Module 10 · End-to-End Design DrillsDay 10050 min

Drill: Distributed Key-Value Store

Build Dynamo from first principles.

Day 100

Drill: Distributed Key-Value Store

Client
client
Coordinator
service
Node 1
datastore
Node 2
datastore
Node 3
datastore
Signal path
Dynamo-like architecture
Client
client
flow
Coordinator
service
Coordinator
service
flow
Node 1
datastore
Coordinator
service
flow
Node 2
datastore
Memory hook

Distributed Key-Value Store: build dynamo from first principles

Mental model

compose the pieces into a design story

Design lens

Highly available but eventually consistent.

Recall anchors
PartitionReplicationFailure

Why it matters

Dynamo-style KV stores ring-partition keys with consistent hashing, replicate to N nodes, use R/W quorums for tunable consistency, and rely on vector clocks or LWW for conflict resolution. They sacrifice strong consistency for availability and scalability.

Deep dive

Consistent hashing with virtual nodes for balance.

Quorum: R+W>N for read-after-write; tunable per request.

Hinted handoff: temporarily store writes for unreachable nodes.

Anti-entropy with Merkle trees keeps replicas in sync over time.

Demo / scenario

Walk through a write.

  1. Hash key → preference list of N=3 nodes.
  2. Coordinator forwards write to all 3.
  3. When W=2 ack, return success.
  4. If a node was down, hint stored at neighbor; replays later.

Tradeoffs

  • Highly available but eventually consistent.
  • Operational complexity is real.
  • Adding a node triggers minimal data movement.

Diagram

Client
Coordinator
Node 1
Node 2
Node 3
Anti-entropy
Dynamo-like architecture.

Mind map

Check yourself

Loading quiz…

Sources & further reading