Skip to content

Case study: Key-value store

Design a Dynamo-style key-value store: a consistent-hash ring, N replicas per key, and R and W quorums that trade consistency for latency and availability.

40 min9 steps

By the end you can
  • Size a replicated store by storage and by throughput, including the replication factor
  • Explain consistent hashing, virtual nodes and preference lists, and the data moved when a node joins
  • Choose N, R and W for a consistency requirement and explain why R + W greater than N gives read-your-writes
  • Predict the effect of packet loss, slow replicas and a partitioned coordinator

Requirements

Operations

  • put/get/delete; conditional version; typical 1 KB, max 1 MB

Targets

  • Single-digit-ms regional p99; tens of TB; 1M ops/s

Availability

  • Writes when quorum reachable; tune consistency per request

A shopping cart must accept 'add to cart' even during a network partition, and can merge conflicting versions later. Which side of the trade-off does it want?

Answer this step to continue.