Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Go
  3. raft

raft

Apache-2.0Gov3.7.0

A stable, widely-used Go library implementing the core Raft consensus algorithm for maintaining a replicated state machine.

GitHubGitHub
1.1k stars277 forks0 contributors

What is raft?

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.

Target Audience

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.

Value Proposition

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.

Overview

Raft library for maintaining a replicated state machine

Use Cases

Best For

  • Building a new distributed database or key-value store that requires a reliable consensus layer.
  • Adding strong consistency to an existing Go-based distributed system or orchestration toolkit.
  • Implementing a custom replicated state machine where control over network transport and storage is required.
  • Educational purposes or prototyping to understand the Raft algorithm with a production-grade, well-documented Go library.
  • Systems requiring dynamic cluster membership changes and leadership transfer capabilities.
  • Applications needing efficient, linearizable read-only queries from both leaders and followers.

Not Ideal For

  • Teams needing an out-of-the-box distributed consensus solution without implementing network transport and disk I/O
  • Projects prioritizing rapid prototyping with higher-level abstractions over fine-grained control
  • Environments requiring consensus in non-Go programming languages
  • Small deployments where the complexity of handling two-node cluster edge cases (as warned in the README) is prohibitive

Pros & Cons

Pros

Production-Proven Reliability

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.

Minimalistic and Flexible

Implements only the core Raft algorithm, leaving network and storage to users, which enables customization and deterministic testing for various use cases.

Full Feature Implementation

Includes all Raft protocol features like leader election, log replication, compaction, membership changes, and extensions such as leadership transfer and linearizable reads.

Performance Optimizations

Offers optional enhancements like pipelining, flow control, and batching to reduce latency and improve throughput, as detailed in the README.

Cons

High Integration Overhead

Users must implement their own network transport and storage layers, which adds significant development complexity compared to monolithic Raft implementations.

Error-Prone Implementation Steps

The library requires careful handling of message persistence and ordering in the Ready loop, increasing the risk of bugs in custom integrations.

Language Limitation

As a Go-specific library, it cannot be directly used in projects written in other languages, limiting its cross-ecosystem applicability.

Cluster Size Constraints

The README cautions against two-node clusters due to potential unrecoverable states during membership changes, necessitating at least three nodes for safety.

Frequently Asked Questions

Quick Stats

Stars1,133
Forks277
Contributors0
Open Issues41
Last commit8 days ago
CreatedSince 2022

Tags

#high-availability#raft-protocol#distributed-systems#go-library#fault-tolerance#consensus#consensus-algorithm#state-machine-replication#cluster-management#raft

Built With

G
Go

Included in

Go169.1k
Auto-fetched 1 day ago

Related Projects

Go-zeroGo-zero

A cloud-native Go microservices framework with cli tool for productivity.

Stars33,362
Forks4,325
Last commit2 days ago
go-kitgo-kit

A standard library for microservices.

Stars27,423
Forks2,438
Last commit2 years ago
KratosKratos

Your ultimate Go microservices framework for the cloud-native era.

Stars25,962
Forks4,180
Last commit20 days ago
grpc-gogrpc-go

The Go language implementation of gRPC. HTTP/2 based RPC

Stars23,093
Forks4,783
Last commit1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub