Library / SDK
databendlabs/openraft avatar
databendlabs/openraft

OpenRaft: A Rust Raft Implementation That Redesigns Voting and Membership Changes

rust raft with improvements. Roadmap [x] 2022-10-31 Extended joint membership [x] 2023-02-14 Minimize confliction rate when electing; See: OpenRaft Vote design; Or use standard Raft leader-ID mode.

2,118 stars269 forksRustApache-2.0

At a glance

What is it?
OpenRaft is an advanced Raft implementation in Rust for distributed storage systems. It extends joint membership and minimizes election conflicts, but its API is not stable before 1.0.0.
Who is it for?
Adopt OpenRaft if you are building a distributed storage system in Rust and need a consensus engine that goes beyond standard Raft, especially for arbitrary membership changes and reduced election conflicts. Do not use it if you require a stable API before 1.0.0; the 0.10 line is alpha and may break compatibility.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly Rust, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • databendlabs/openraft2,118 ★ · +139
Star history
Repository2026-07-282026-11-15
databendlabs/openraft2k2.1k

139 Stars in the last 110 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

What OpenRaft Solves for Distributed Storage Builders

OpenRaft targets developers building distributed data systems: SQL, NoSQL, KV, streaming, graph, or something more exotic. Standard Raft implementations often force one-node-at-a-time membership changes and suffer from election conflicts that waste terms. OpenRaft addresses both. The README states it is the consensus engine of the meta-service cluster in Databend, so it is not a toy. The project derives from async-raft but fixes several bugs, as documented in derived-from-async-raft.md. If you need a Raft library that lets you change an arbitrary set of nodes in one operation and reduce split-vote churn, OpenRaft is built for that specific gap.

How the Vote Redesign Reduces Election Conflicts

Standard Raft increments the term on every election, and a split vote forces a new term, causing repeated conflicts. OpenRaft introduces a redesigned Vote that minimizes the conflict rate. According to the roadmap, a split vote does not force a new term. The design is documented in the Vote data type and the LeaderId data type. The README mentions two modes: the new leader-ID mode and the standard Raft leader-ID mode. This is a concrete mechanism, not a vague claim. The practical effect is fewer term increments under contention, which should reduce log disruptions. The documentation does not give a formal proof, but the design discussion link suggests the reasoning is public.

Extended Joint Membership for Arbitrary Node Changes

Standard Raft changes membership one node at a time, which is slow and restrictive. OpenRaft implements extended joint membership, allowing an arbitrary set of nodes to be changed in a single operation. The README calls standard Raft's approach a restricted special case. This matters for operators who need to replace multiple nodes at once, for example during a datacenter migration. The implementation is in the ExtendedMembership data type. The trade-off is complexity: joint consensus is harder to reason about than simple majorities. OpenRaft's deterministic simulation fuzzer and Jepsen suite are designed to catch the subtle bugs that arise from this complexity.

Getting Started: Commands and Configuration

OpenRaft is a Rust crate, so you add it via Cargo. The README points to the getting started guide at docs.rs/openraft/0.10.0-alpha.34/openraft/docs/getting_started/index.html. The examples for version 0.10 live in the release-0.10 branch and require openraft 0.10.0-alpha.34. For version 0.9, examples are in the release-0.9 branch. The main configuration key mentioned is Config::enable_pre_vote, a boolean that enables the pre-vote feature. Pre-vote lets a node ask peers whether they would grant a vote before incrementing its term. The README does not list a full config file, so you must consult the guide for the complete set of fields. The alpha version number means you should pin the exact version in Cargo.toml.

Performance Numbers: What They Do and Do Not Mean

The README reports 33,000 writes per second for a single writer and up to 5,615,000 writes per second with batch writes. It explicitly warns that these benchmarks run on a minimized store and network, and are NOT a real world application benchmark. That warning is important. The numbers measure the framework's overhead, not the throughput you will get with a real disk and network. The benchmark folder benchmarks/minimal contains the details. Treat these figures as an upper bound for the consensus layer alone. If you need a realistic estimate, you must benchmark with your own storage backend and network conditions.

Testing and Chaos Verification

OpenRaft claims 92% unit test coverage. More importantly, it runs a deterministic simulation fuzzer in tests-turmoil on every CI build. This fuzzer explores interleavings deterministically, which is far more effective than random testing for consensus bugs. The Jepsen suite runs eight nemesis scenarios on every push to main: network partition, process pause, process kill, slow packets, flaky packets, clock skew, membership churn, and all combined. This is a serious investment in correctness. The trade-off is that the test infrastructure is complex to adapt to your own application. The fuzzer is tied to the library's internals, so you cannot directly reuse it for your custom logic.

API Stability and Upgrade Costs

The README is blunt: the OpenRaft API is not stable yet. Before 1.0.0, an upgrade may contain incompatible changes. The change-log uses commit prefixes to signal severity: data-change means on-disk data types change and may require manual upgrade, change means incompatible API changes, feat is compatible, fix is a bug fix. The 0.10 line is alpha, and the 0.9 line only accepts bug fixes. This means you must budget for migration work between versions. The project provides upgrade guides, for example from 0.9 to 0.10. If you cannot tolerate breaking changes, wait for a stable release or pin to a specific version and treat upgrades as separate projects.

A Real Alternative: async-raft and Standard Raft

OpenRaft is derived from async-raft, so that is the most direct alternative. The difference is that OpenRaft fixes bugs in async-raft and adds features like extended joint membership and the redesigned Vote. Standard Raft, as implemented in other libraries, uses one-node-at-a-time membership changes and the original leader-ID mode. If you need strict adherence to the original Raft paper for certification or simplicity, standard Raft is safer. If you need arbitrary membership changes and reduced election conflicts, OpenRaft offers a concrete advantage. The cost is a less stable API and a more complex implementation. Choose based on whether you need the extensions, not on star counts.

Editorial conclusion

Adopt OpenRaft if you are building a distributed storage system in Rust and need a consensus engine that goes beyond standard Raft, especially for arbitrary membership changes and reduced election conflicts. Do not use it if you require a stable API before 1.0.0; the 0.10 line is alpha and may break compatibility. Before adopting, verify the current change-log for data-change commits, review the 0.9 to 0.10 upgrade guide, and run the deterministic simulation fuzzer against your own configuration. The project is production-used in Databend's meta-service, but the API instability means you must budget for migration work.

Frequently asked questions

What is OpenRaft?

A Raft consensus implementation in Rust that runs on any async runtime. It is the consensus engine of the meta-service cluster in databend, and it is derived from an earlier async Raft project with a documented list of bugs fixed. It is published under a dual MIT or Apache 2.0 licence.

Is the OpenRaft API stable?

Not yet, and the project says so plainly: before 1.0.0 an upgrade may contain incompatible changes. The 0.10 line is in alpha, the 0.9 branch accepts bug fixes only, and the 0.8, 0.7 and 0.6 branches are closed with their upgrade guides still published. Commit messages carry keywords that classify the risk of a change.

How does OpenRaft differ from standard Raft?

Two changes are documented. Generalized membership change uses extended joint membership to alter an arbitrary set of nodes in one operation, where standard Raft's one-node-at-a-time change is described as a restricted special case. A redesigned Vote type minimises election conflict, so a split vote does not force a new term. The standard Raft leader-ID mode is also supported, and pre-vote is available as a configuration flag.

Does Kubernetes use Raft, and does OpenRaft support it?

This page does not mention Kubernetes at all, so it cannot answer that. What it names as a production user is the meta-service cluster in databend. The testing it describes is a deterministic simulation fuzzer in every CI build and a Jepsen suite running eight named nemesis scenarios on every push to main.

What are the OpenRaft write throughput numbers?

The status line quotes 33,000 writes per second for a single writer and 5,615,000 with batch writes. The first is the single-client row of the single-writes table, the second is the 4096-client row of a batch table with four entries per batch, and the benchmark is described in capitals as not a real world application benchmark, run on a minimised store and network.

Official sources

  1. Official README
  2. Project repository
  3. Release notes
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/databendlabs-openraft.svg)](https://hysenlabs.com/projects/databendlabs-openraft)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/databendlabs-openraft.svg)](https://hysenlabs.com/projects/databendlabs-openraft)

Was this useful?