A stable, widely-used Go library implementing the core Raft consensus algorithm for maintaining a replicated state machine.
etcd-io/raft is a Go implementation of the Raft consensus algorithm, which enables a cluster of nodes to maintain a replicated state machine through a replicated log. It is the most widely used Raft library in production, powering major distributed systems like etcd, Kubernetes, and CockroachDB. The library follows a minimalistic design, focusing solely on the core algorithm to provide flexibility, determinism, and high performance.
Go developers building distributed systems that require strong consistency, such as databases, key-value stores, orchestration toolkits, and blockchain networks. It is also suitable for those who need a production-proven, embeddable consensus layer.
Developers choose this library because it is the most widely used and production-tested Raft implementation, offering a minimalistic design that decouples the core algorithm from network and storage layers for maximum flexibility and deterministic testing. Its optional performance enhancements, like pipelining and batching, provide high throughput and low latency.
Raft library for maintaining a replicated state machine
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
It is the most widely used Raft library, serving tens of thousands of clusters daily in systems like Kubernetes and CockroachDB, ensuring battle-tested robustness.
Implements only the core Raft algorithm, leaving network and storage to users, which enables customization and deterministic testing for various use cases.
Includes all Raft protocol features like leader election, log replication, compaction, membership changes, and extensions such as leadership transfer and linearizable reads.
Offers optional enhancements like pipelining, flow control, and batching to reduce latency and improve throughput, as detailed in the README.
Users must implement their own network transport and storage layers, which adds significant development complexity compared to monolithic Raft implementations.
The library requires careful handling of message persistence and ordering in the Ready loop, increasing the risk of bugs in custom integrations.
As a Go-specific library, it cannot be directly used in projects written in other languages, limiting its cross-ecosystem applicability.
The README cautions against two-node clusters due to potential unrecoverable states during membership changes, necessitating at least three nodes for safety.