This repository contains an experimental implementation of Raft in Go, built as a personal learning project for me to better understand the Raft consensus algorithm and Go concurrency.
The primary goal of this project is conceptual clarity and architectural correctness, not production readiness. This code is not intended for use in production systems.
- Single event loop
- All core Raft logic runs in a single event loop, to avoid complicated race conditions.
- External events (RPCs, client requests, timeouts) are funneled into the loop via channels.
- Separation of concerns
- Persistent state and communication is abstracted behind interfaces.
This implementation is inncomplete. Known gaps include:
- Limited cluster test coverage
- Limited concurrency, in favor of simplicity
- No snapshotting or log compaction
- Blocked node during candidature
These tradeoffs were made to keep the project focused on core Raft mechanics.
- In Search of an Understandable Consensus Algorithm — Ongaro & Ousterhout
- HashiCorp Raft (for comparison, not as a base)