noraft
noraft: Minimal, feature-complete Raft for Rust - no I/O, no dependencies.
noraft is a minimal but feature-complete, sans I/O implementation of the Raft distributed consensus algorithm.
Node is the main struct that represents a Raft node.
It offers methods for creating a cluster, proposing commands, updating cluster configurations,
handling incoming messages, snapshotting, and more.
Node itself does not execute I/O operations.
Instead, it generates Actions that represent pending I/O operations.
How to execute these actions is up to the crate user.
noraft keeps its API surface minimal and lets users choose and integrate their own I/O layer freely.
Except for a few optimizations, noraft is a very straightforward (yet efficient) implementation of the Raft algorithm.
This crate focuses on the core part of the algorithm.
So, offering various convenience features (which are not described in the Raft paper) is left to the crate user.
The following example outlines a basic usage flow of this crate:
// Start a node.
let mut node = start;
// Create a three nodes cluster.
let commit_position = node.create_cluster;
// Execute actions requested by the node until the cluster creation is complete.
while node.get_commit_status.is_in_progress
// Propose a user-defined command.
let commit_position = node.propose_command;
// Execute actions as before.