An implementation of the Raft distributed consensus protocol using the Actix actor framework. Blazing fast Rust, a modern consensus protocol, an outstanding actor framework. This project intends to provide a backbone for the next generation of distributed data storage systems (SQL, NoSQL, KV, Streaming &c) built with Rust. Please ⭐ on github!
This crate differs from other Raft implementations in that:
- It is fully reactive and embraces the async ecosystem. It is driven by actual Raft related events taking place in the system as opposed to being driven by a
tickoperation. Batching of messages during replication is still used whenever possible for maximum throughput.
- Storage and network integration is well defined via the two traits
RaftNetwork. This provides applications maximum flexibility in being able to choose their storage and networking mediums. This also allows for the storage interface to be synchronous or asynchronous based on the storage engine used, and allows for easy integration with the actix ecosystem's networking components for efficient async networking. See the storage & network chapters of the guide.
- Submitting Raft RPCs & client requests to a running Raft node is also well defined via the Actix message types defined in the
messagesmodule in this crate. The API for this system is clear and concise. See the raft chapter in the guide.
- It fully supports dynamic cluster membership changes according to the Raft spec. See the
dynamic membershipchapter in the guide.
- Details on initial cluster formation, and how to effectively do so from an application level perspective, are discussed in the cluster formation chapter in the guide.
This implementation strictly adheres to the Raft spec (pdf warning), and all data models use the same nomenclature found in the spec for better understandability. This implementation of Raft has integration tests covering all aspects of a Raft cluster's lifecycle including: cluster formation, dynamic membership changes, snapshotting, writing data to a live cluster and more.
If you are building an application using this Raft implementation, open an issue and let me know! I would love to add your project's name & logo to a users list in this project.
Check out the CONTRIBUTING.md guide for more details on getting started with contributing to this project.
actix-raft is licensed under the terms of the MIT License or the Apache License 2.0, at your choosing.
NOTE: the appearance of the "section" symbols
§ throughout this project are references to specific sections of the Raft spec.