- Notifications
You must be signed in to change notification settings - Fork166
rust raft with improvements
License
Apache-2.0, MIT licenses found
Licenses found
databendlabs/openraft
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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 indatabend.
🚀Get started:
- Openraft guide is the best place to get started,
- Openraft docs for more in-depth details,
- Openraft FAQ explains some common questions.
💡Example Applications:
- Examples with Openraft 0.9 require Openraft 0.9 oncrate.io/openraft
- Examples with Openraft 0.10 require Openraft 0.10, which is not yet published on crate.io;
🙌Questions?
- Why not take a peek at ourFAQ? You might find just what you need.
- Wanna chat? Come hang out with us onDiscord!
- Or start a new discussion over onGitHub.
- Or join ourFeishu group.
- And hey, if you're on WeChat, add us:
drmingdrmer
. Let's get the conversation started!
Whatever your style, we're here to support you. 🚀 Let's make something awesome together!
- Openraft is derived fromasync-raft with several bugs fixed:Fixed bugs.
- The features are almost complete for building an application.
- Performance: Supports 70,000 writes/sec for single writer, and 1,000,000 writes/sec for 256 writers. See:Performance
- Unit test coverage stands at 92%.
- The chaos test has not yet been completed, and further testing is needed to ensure the application's robustness and reliability.
Openraft API is not stable yet. Before
1.0.0
, an upgrade may contain incompatible changes.Check ourchange-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 therelease-0.10.
Branchrelease-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.Branchrelease-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.Branchrelease-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.Branchrelease-0.6:Latest: (v0.6.8 |Change log );
release-0.6
won't accept new features but only bug fixes.
- 2022-10-31Extended joint membership
- 2023-02-14 Minimize confliction rate when electing;See:Openraft Vote design;Or use standard raft mode withfeature flag
single-term-leader
. - 2023-04-26 Goal performance is 1,000,000 put/sec.
- Reduce the complexity of vote and pre-vote:get rid of pre-vote RPC;
- Support flexible quorum, e.g.:Hierarchical Quorums
- Consider introducing read-quorum and write-quorum,improve efficiency with a cluster with an even number of nodes.
The benchmark is focused on the Openraft framework itself and is run on aminimized store and network. This isNOT a real world application benchmark!!!
clients | put/s | ns/op |
---|---|---|
256 | 1,014,000 | 985 |
64 | 730,000 | 1,369 |
1 | 70,000 | 14,273 |
For benchmark detail, go to the./cluster_benchmark folder.
- Async and Event-Driven: Operates based on Raft events without reliance on periodic ticks, optimizing message batching for high throughput.
- Extensible Storage and Networking: Customizable via
RaftLogStorage
,RaftStateMachine
andRaftNetwork
traits, allowing flexibility in choosing storage and network solutions. - Unified Raft API: Offers a single
Raft
type for creating and interacting with Raft tasks, with a straightforward API. - Cluster Formation: Provides strategies for initial cluster setup as detailed in thecluster formation guide.
- Built-In Tracing Instrumentation: The codebase integratestracing for logging and distributed tracing, with the option toset verbosity levels at compile time.
- ✅Leader election: by policy or manually(
trigger_elect()
). - ✅Non-voter(learner) Role: refer to
add_learner()
. - ✅Log Compaction(snapshot of state machine): by policy or manually(
trigger_snapshot()
). - ✅Snapshot replication.
- ✅Dynamic Membership: using joint membership config change. Refer todynamic membership
- ✅Linearizable read:
ensure_linearizable()
. - ⛔️Wont support: Single-step config change.
- ✅ Toggle heartbeat / election:
enable_heartbeat
/enable_elect
. - ✅ Trigger snapshot / election manually:
trigger_snapshot()
/trigger_elect()
. - ✅ Purge log by policy or manually:
purge_log()
.
- Databend - The Next-Gen Cloud [Data+AI] Analytics
- CnosDB - A cloud-native open source distributed time series database.
- yuyang0/rrqlite - A rust implementation ofrqlite.
- raymondshe/matchengine-raft - A example to demonstrate how openraft persists snapshots/logs to disk.
- Helyim -SeaweedFS implemented in pure Rust.
- RobustMQ - Next generation cloud-native converged message queue.
Check out theCONTRIBUTING.mdguide for more details on getting started with contributing to this project.
Made withcontributors-img.
Openraft is licensed under the terms of theMIT Licenseor theApache License 2.0, at your choosing.
About
rust raft with improvements