#raft #raft-consensus #data-storage #distributed-consensus #raft-storage #actix-actor #node

actix-raft

An implementation of the Raft distributed consensus protocol using the Actix actor framework

12 unstable releases (3 breaking)

0.4.4 Apr 18, 2020
0.4.3 Feb 13, 2020
0.4.2 Oct 17, 2019
0.3.1 Oct 3, 2019
0.1.3 Aug 27, 2019

#1133 in Asynchronous

31 downloads per month

MIT/Apache

235KB
3K SLoC

actix raft

Build Status Crates.io docs.rs License Crates.io Crates.io GitHub issues open GitHub issues closed

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!

The guide is the best place to get started, followed by the docs for more in-depth details.

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 tick operation. Batching of messages during replication is still used whenever possible for maximum throughput.
  • Storage and network integration is well defined via the two traits RaftStorage & 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 messages module 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 membership chapter 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.

contributing

Check out the CONTRIBUTING.md guide for more details on getting started with contributing to this project.

license

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.

Dependencies

~10MB
~185K SLoC