Distributed key-value stores (such as TiKV, Cassandra, CockroachDB storage nodes, and etcd) form the foundational substrate upon which modern internet-scale data infrastructure is built.

Designing a robust distributed KV store requires unifying deep hardware reality and distributed systems theory:

  • Single-Node Storage Engine: How to maximize sequential NVMe write throughput and minimize read amplification using Log-Structured Merge-Trees (LSM).
  • Consensus & State Machine Replication: How to ensure linearizable consistency and survive network partitions across nodes using Raft consensus.
  • Horizontal Elasticity: How to distribute partitions across an elastic cluster of nodes using consistent hashing with virtual nodes.

This Capstone project synthesizes the core algorithms of storage engineering and distributed consensus into a comprehensive, production-grade architectural specification.

What you will learn

  • Construct an LSM-tree storage engine from first principles: Write-Ahead Log (WAL), SkipList MemTable, SSTables with sparse index, and Leveled Compaction
  • Integrate Raft consensus for state machine replication: leader election, log replication, commit index safety, and lease reads
  • Implement virtual-node consistent hashing and partition routing for horizontal multi-shard scale
  • Diagnose distributed failure modes: split-brain elections, disk write amplification, uncommitted log rollbacks, and recovery after power loss
STAGE TOPICS

Topics in this chapter