one-file-raft

Crates.ioone-file-raft
lib.rsone-file-raft
version0.1.1
sourcesrc
created_at2024-01-25 08:27:27.100695
updated_at2024-03-07 02:52:24.911241
descriptionRaft consensus in 300 LOC
homepagehttps://github.com/drmingdrmer/one-file-raft
repositoryhttps://github.com/drmingdrmer/one-file-raft
max_upload_size
id1113559
size83,617
张炎泼 (drmingdrmer)

documentation

https://docs.rs/one-file-raft

README

one-file-raft

This is a concise, demonstrative implementation of the Raft consensus algorithm contained within a single Rust file, approximately 300 lines in length.

The primary objective is to provide an educational demo that shows the core principles of a distributed consensus protocol, free from the complexities of application-specific business logic, edge case management, and error handling.

The implementation focuses on the fundamental aspects of Raft, such as leader election, log replication and log commit, while omitting advanced features like log compaction and log purging.

./loc.sh
     300

For a production use of Raft, refer to Openraft

Commit count: 0

cargo fmt