This project intends to improve raft as the next-generation consensus protocol for distributed data storage systems (SQL, NoSQL, KV, Streaming, Graph ... or maybe something more exotic).
Currently, openraft is the consensus engine of meta-service cluster in databend.
- ๐ Get started: Guide ยท Docs ยท FAQ ยท DeepWiki.
- ๐ก Examples: 0.10.0 ยท 0.9.
- ๐ Questions? Ask on Discord, in a GitHub discussion, in our Feishu group, or on WeChat:
drmingdrmer.
Status
- Features: OpenRaft implements nearly all features needed to build applications with Raft.
- Performance: OpenRaft supports 33,000 writes/sec with a single writer and 5,615,000 writes/sec with batch writes. See the benchmarks.
- Coverage: Unit test coverage is 92%.
- Chaos testing: A deterministic simulation fuzzer runs in every CI build.
The Jepsen suite runs 8 nemesis scenarios on every push to
main: network partition, process pause, process kill, slow packets, flaky packets, clock skew, membership churn, and all seven combined.
API status
OpenRaft's API continues to evolve. Upgrades before 1.0.0 may include incompatible changes.
See the changelog. Commit messages start with a keyword indicating the type of change:
data-change:changes on-disk data types and may require a manual upgrade.change:introduces incompatible changes.feat:adds compatible, non-breaking features.fix:contains only bug fixes.
Versions
| Branch | Status | Release | Upgrade guide |
|---|---|---|---|
main / release-0.10 |
Stable; active development | 0.10.0 | 0.9 โ 0.10 |
| release-0.9 | Bug fixes only | 0.9.26 (changelog) | 0.8 โ 0.9 |
release-0.8, release-0.7, and release-0.6 are closed; their upgrade guides remain available.
Performance
This benchmark measures the OpenRaft framework with minimal storage and networking; see benchmark details.
| Clients | Single writes (put/s) | Batch writes (4 entries/batch, put/s) |
|---|---|---|
| 4096 | 3,548,000 | 5,615,000 |
| 1024 | 3,006,000 | โ |
| 256 | 1,808,000 | โ |
| 64 | 912,000 | โ |
| 1 | 33,000 | โ |
Features
- โ Generalized membership changes: change any set of nodes in one operation, using one log entry when safe or joint consensus otherwise.
- โ Flexible quorums: choose threshold, weighted, hierarchical, grid, explicit, or custom rules, with separate election and commit quorums.
- โ High throughput: streaming replication and batch writes, backed by an async, event-driven core.
- โ Linearizable reads: reads confirmed by a quorum, lease reads, and follower reads.
- โ Fully pluggable: customize storage, networking, snapshot transport, and core Raft types.
- โ
Runtime choice: Tokio, compio, or monoio, with support for
single-threadedapplications. - โ Tested with Turmoil and Jepsen: deterministic simulation and fault testing check Raft invariants, linearizability, and recovery.
See the full feature list.
Who uses it
- Databend - Cloud analytics.
- Walrus - Distributed message streaming.
- Hiqlite - Embedded SQLite with caching.
Contributing
Check out the CONTRIBUTING.md guide for more details on getting started with contributing to this project.
Contributors
Thanks to everyone who contributes to OpenRaft:
License
OpenRaft is licensed under the terms of the MIT License or the Apache License 2.0, at your choosing.
OpenRaft originated from async-raft.