Skip to content
Backend system design · about 45 minutes

Distributed key-value store

Design a key-value store that runs on many machines, with put, get and delete by key. The store must hold more data than one machine can hold, and it must continue to answer when a machine or a network link fails. The clients are other services of the company, and they expect an answer in a few milliseconds.

Ask first

  • How much data is there, how large is a value, and how many reads and writes come each second?
  • Which is worse for the clients: an old value, or no answer during a failure?
  • Is access only by key, or do you also need range scans or queries on the value?
  • Must a write survive a power failure, or is the store a cache that can lose data?
  • Does the store run in one data center or in several regions?

The outline

Write your own outline for each part first.

The strong answer, the pitfalls and the follow-ups opens with a year in the app. What a year includes