Design a Replicated Key-Value Store on Top of RocksDB Shards

Last updated: November 29, 2026

Quick Overview

Design a strongly consistent, distributed key-value store that many Meta product teams can use for small metadata, built from RocksDB instances on each host and a replication layer across regions.

Meta
System Design
Software Engineer
Meta
November 29, 2026
Software Engineer
System Design Round
System Design
Hard

0

0

0 solved


Design a strongly consistent, distributed key-value store that many Meta product teams can use for small metadata, built from RocksDB instances on each host and a replication layer across regions.

Meta runs general-purpose KV services built on RocksDB, and storage-team interviews ask candidates to build one from parts. The interviewer checks shard placement, consensus-based replication, LSM write and compaction behavior, and how tenants are isolated.

What the Interviewer Expects
  • Explain the LSM-tree write path and compaction costs
  • Shard the keyspace and manage placement
  • Replicate each shard with a consensus protocol
  • Offer per-request consistency choices
  • Isolate noisy tenants
Key Topics to Cover
LSM trees
Raft or Paxos
Sharding
Consistency levels
Multi-tenancy
How to Approach This
  1. Start by clarifying functional and non-functional requirements with the interviewer.
  2. Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
  3. Draw a high-level architecture first, then deep dive into 1-2 critical components.
  4. Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
  5. Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
  • How do you split a shard that grew to 500 GB?
  • What does a read from a follower guarantee?
  • How do you handle a region-wide outage of the leader?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice System Design Problems
Sample Answer
Requirements

Functional: get, put, delete, conditional put (compare-and-set), range scan within a key prefix, TTL.

Non-functional: single-digit ms p99 reads, durable writes, survive a full region loss, ma...

High-Level Design
  • Storage nodes run one RocksDB instance per shard replica.
  • Each shard has 3 or 5 replicas across regions forming a consensus group (Raft-like); one is leader.
  • A shard manager owns pla...

Submit Your Answer
Markdown supported