Skip to content

getong/openraft

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2,771 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenRaft

Advanced Raft in 🦀 Rust on any async runtime. Please ⭐ on GitHub!

Crates.io docs.rs DeepWiki guides Discord Chat
CI Coverage Status License Crates.io Crates.io

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.

Whatever your style, we're here to support you. 🚀 Let's make something awesome together!

Status

  • The features are almost complete for building an application.
  • Performance: Supports 33,000 writes/sec for a single writer and 5,615,000 writes/sec with batch writes. 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.

API status

  • 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.

Versions

Roadmap

Performance

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.

Features

What sets OpenRaft apart from a standard Raft implementation:

  • Generalized membership change: extended joint membership changes an arbitrary set of nodes in a single operation; standard Raft's one-node-at-a-time change is a restricted special case.
  • Fewer election conflicts: the redesigned Vote minimizes election conflict rate — a split vote does not force a new term; the standard Raft leader-ID mode is also supported.
  • Async and event-driven: state transitions are driven by Raft events without periodic ticks; messages are batched, reaching millions of writes/sec in the framework benchmark.
  • Fully pluggable: storage (RaftLogStorage, RaftStateMachine), networking (RaftNetworkV2, including application-defined snapshot transport), and every core type — node ID, node, term, vote, log entry — via RaftTypeConfig.
  • Runtime-agnostic: tokio by default, compio and monoio via the AsyncRuntime trait, and a single-threaded mode that removes Send bounds.
  • Deterministically tested: a turmoil-based simulation fuzzer steps the cluster tick by tick and verifies Raft invariants from the paper and the TLA+ spec after every tick.
  • Observable: streaming metrics via watch channels, and tracing instrumentation with compile-time verbosity filtering.

Functionality:

Who uses it

  • Databend - The Next-Gen Cloud [Data+AI] Analytics
  • Walrus - Distributed message streaming engine with Raft-based metadata coordination.
  • CnosDB - A cloud-native open source distributed time series database.
  • RobustMQ - Next generation cloud-native converged message queue.
  • RocketMQ-rust - Apache RocketMQ reimplemented in Rust.
  • Hiqlite - Highly-available, embeddable, Raft-based SQLite with caching.
  • Octopii - A distributed systems kernel for building replicated, fault-tolerant services.
  • Renegade - On-chain dark pool for anonymous trading.
  • Helyim - SeaweedFS implemented in pure Rust.
  • Ahnlich - In-memory vector database with an AI proxy.
  • raymondshe/matchengine-raft - A example to demonstrate how openraft persists snapshots/logs to disk.
  • tsoracle - Distributed timestamp and sequence oracle serving strictly monotonic, gapless IDs.
  • yuyang0/rrqlite - A rust implementation of rqlite.

📣 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.

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:

@ariesdevil @AustenSchunk @bohutang @byronwasti @caicancai @CentRa-Linux @claude @cliff0412 @ClSlaid @danthegoodman1 @devillove084 @Diggsey @diptanu @drmingdrmer @eliasyaoyc @emmanuel-ferdman @emon100 @ethe @evanj @George-Miao @getong @GrapeBaBa @gtema @guojidan @hadronzoo @HaHa421 @homa31 @iamazy @iMashtak @Jason5Lee @jdockerty @jgrund @jkosh44 @josedab @justinlatimer @kper @leiysky @Licenser @lichuang @linsinn @Lymah123 @maackle @maciejkow @manuelarte @manuelgdlvh @MarinPostma @markus-behrens @marvin-j97 @mengxuroblox @mfelsche @Miaxos @monoid @MrCroxx @nasuiyile @Nicholas-Ball @penghs520 @PeterKnego @pfwang80s @Phoenix500526 @pinylin @ppamorim @PsiACE @Qian-Cheng-nju @rvielma @sainad2222 @schreter @SebastianThiebaud @shuoli84 @socutes @sollhui @SteveLauC @sunli829 @sunsided @svix-jplatte @tangwz @thedodd @tisonkun @tobodner @trungda @tvsfx @undecidedapollo @Veeupup @vigith @wvwwvwwv @xu-cheng @Xuanwo @YangKian @ygf11 @youichi-uda @zach-schoenberger @zhixinwen

License

OpenRaft is licensed under the terms of the MIT License or the Apache License 2.0, at your choosing.

About

rust raft with improvements

Resources

License

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages

  • Rust 98.2%
  • Python 1.2%
  • Other 0.6%