Work

Raft Consensus

Implementation of the Raft consensus algorithm in Go. Leader election, log replication, and snapshotting for a fault-tolerant key-value store.

Role

Backend Engineer

Year

2025

Source

GitHub
GoDistributed SystemsgRPCProtocol Buffers

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%