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:
💡 Example Applications:
0.10.0-alpha.34 (alpha) on crates.io/openraft;🙌 Questions?
drmingdrmer. Let's get the conversation started!Whatever your style, we're here to support you. 🚀 Let's make something awesome together!
OpenRaft API is not stable yet. Before 1.0.0, an upgrade may contain incompatible changes. Check our change-log. A commit message starts with a keyword to indicate the modification type of the commit:
DataChange: on-disk data types changes, which may require manual upgrade.Change: if it introduces incompatible changes.Feature: if it introduces compatible non-breaking new features.Fix: if it just fixes a bug.Branch main has been under active development. The main branch is for the release-0.10. Latest alpha on crates.io: v0.10.0-alpha.34. The 0.10 line is in alpha — the API may still change before the final 0.10.0 release.
Branch release-0.9: Latest: ( v0.9.0 | Change log ); Upgrade guide: ⬆️ 0.8 to 0.9; release-0.9 Won't accept new features but only bug fixes.
Branch release-0.8: Latest: ( v0.8.8 | Change log ); Upgrade guide: ⬆️ 0.7 to 0.8, ⬆️ 0.8.3 to 0.8.4; release-0.8 Won't accept new features but only bug fixes.
Branch release-0.7: Latest: ( v0.7.6 | Change log ); Upgrade guide: ⬆️ 0.6 to 0.7; release-0.7 Won't accept new features but only bug fixes.
Branch release-0.6: Latest: ( v0.6.8 | Change log ); release-0.6 won't accept new features but only bug fixes.
The benchmark is focused on the OpenRaft framework itself and is run on a minimized store and network. This is NOT a real world application benchmark!!!
Single writes:
| clients | put/s |
|---|---|
| 4096 | 3,548,000 |
| 1024 | 3,006,000 |
| 256 | 1,808,000 |
| 64 | 912,000 |
| 1 | 33,000 |
Batch writes (4 entries per batch):
| clients | put/s |
|---|---|
| 4096 | 5,615,000 |
For benchmark detail, go to the ./benchmarks/minimal folder.
What sets OpenRaft apart from a standard Raft implementation:
RaftLogStorage, RaftStateMachine), networking (RaftNetworkV2, including application-defined snapshot transport), and every core type — node ID, node, term, vote, log entry — via RaftTypeConfig.AsyncRuntime trait, and a single-threaded mode that removes Send bounds.Trigger::elect()).Trigger::transfer_leader().Config::enable_pre_vote.add_learner().Trigger::snapshot()).ensure_linearizable().Raft::metrics(), Raft::data_metrics(), and Raft::server_metrics().RuntimeConfigHandle::heartbeat() / RuntimeConfigHandle::elect().Trigger::snapshot() / Trigger::elect().Trigger::purge_log().📣 Using openraft in your project? We'd love to feature it here — open an issue to let us know, or skip the wait and submit a pull request directly.
Check out the CONTRIBUTING.md guide for more details on getting started with contributing to this project.
Thanks to everyone who contributes to OpenRaft:
OpenRaft is licensed under the terms of the MIT License or the Apache License 2.0, at your choosing.