← back

Distributed Key-Value Store

2025 · Go · Distributed Systems

Go Raft WAL gRPC

A distributed key-value store built from scratch to understand consensus protocols and storage engine design. Supports linearizable reads, strong consistency, and automatic leader election.

Problem

Most KV stores abstract away the hard parts — consensus, log replication, and failure recovery. I wanted to understand what happens at each layer by building it.

Architecture

The system is structured in three layers:

Design Decisions

What I Learned

Raft is deceptively simple on paper. The edge cases — split votes, log conflicts during network partitions, snapshot installation — took most of the debugging time. The hardest part was not the algorithm, but making the state transitions observable enough to reason about failures.

Key Numbers