Raft Consensus
Overview
A from-scratch implementation of the Raft consensus protocol powering a distributed key-value store. Supports leader election, log replication, membership changes, and log compaction via snapshots.
Approach
Built as a learning exercise to deeply understand distributed consensus. The implementation follows the extended Raft paper closely, with a gRPC transport layer for inter-node communication and a simple HTTP API for client operations.
Results
- Passes all Raft paper test scenarios including network partitions
- Handles 5-node clusters with automatic failover under 2 seconds
- Snapshot-based recovery reduces log replay time by 95%