All Projects → tikv → Raft Rs

tikv / Raft Rs

Licence: apache-2.0
Raft distributed consensus algorithm implemented in Rust.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Raft Rs

Odin
A programmable, observable and distributed job orchestration system.
Stars: ✭ 405 (-78.21%)
Mutual labels:  raft, distributed-systems
Ra
A Raft implementation for Erlang and Elixir that strives to be efficient and make it easier to use multiple Raft clusters in a single system.
Stars: ✭ 478 (-74.29%)
Mutual labels:  raft, distributed-systems
Nuraft
C++ implementation of Raft core logic as a replication library
Stars: ✭ 428 (-76.98%)
Mutual labels:  raft, distributed-systems
Etcd
Distributed reliable key-value store for the most critical data of a distributed system
Stars: ✭ 38,238 (+1956.91%)
Mutual labels:  raft, distributed-systems
Blog
my blog, using markdown
Stars: ✭ 25 (-98.66%)
Mutual labels:  raft, distributed-systems
Raft
An Elixir implementation of the raft consensus protocol
Stars: ✭ 369 (-80.15%)
Mutual labels:  raft, distributed-systems
Pysyncobj
A library for replicating your python class between multiple servers, based on raft protocol
Stars: ✭ 468 (-74.83%)
Mutual labels:  raft, distributed-systems
coolbeans
Coolbeans is a distributed work queue that implements the beanstalkd protocol.
Stars: ✭ 56 (-96.99%)
Mutual labels:  distributed-systems, raft
Kingbus
A distributed MySQL binlog storage system built on Raft
Stars: ✭ 798 (-57.07%)
Mutual labels:  raft, distributed-systems
Hraftd
A reference use of Hashicorp's Raft implementation
Stars: ✭ 732 (-60.62%)
Mutual labels:  raft, distributed-systems
Dragonboat
Dragonboat is a high performance multi-group Raft consensus library in pure Go.
Stars: ✭ 3,983 (+114.25%)
Mutual labels:  raft, distributed-systems
6.824 2018
MIT 6.824 2018 lab. MIT6.824分布式系统(2018秋)
Stars: ✭ 59 (-96.83%)
Mutual labels:  raft, distributed-systems
kerala
Distributed KV Streams
Stars: ✭ 16 (-99.14%)
Mutual labels:  distributed-systems, raft
Raft
Raft Consensus Algorithm
Stars: ✭ 370 (-80.1%)
Mutual labels:  raft, distributed-systems
Kites
🪁 A consistency, partition tolerance completed distributed KV store, implementation of the Raft distributed consensus protocol and Kotlin.
Stars: ✭ 41 (-97.79%)
Mutual labels:  distributed-systems, raft
Elasticell
Elastic Key-Value Storage With Strong Consistency and Reliability
Stars: ✭ 453 (-75.63%)
Mutual labels:  raft, distributed-systems
MIT6.824-2021
4 labs + 2 challenges + 4 docs
Stars: ✭ 594 (-68.05%)
Mutual labels:  distributed-systems, raft
golearn
🔥 Golang basics and actual-combat (including: crawler, distributed-systems, data-analysis, redis, etcd, raft, crontab-task)
Stars: ✭ 36 (-98.06%)
Mutual labels:  distributed-systems, raft
Copycat
A novel implementation of the Raft consensus algorithm
Stars: ✭ 551 (-70.36%)
Mutual labels:  raft, distributed-systems
Rqlite
The lightweight, distributed relational database built on SQLite
Stars: ✭ 9,147 (+392.04%)
Mutual labels:  raft, distributed-systems

Raft

Build Status Documentation Crates.io dependency status

Problem and Importance

When building a distributed system one principal goal is often to build in fault-tolerance. That is, if one particular node in a network goes down, or if there is a network partition, the entire cluster does not fall over. The cluster of nodes taking part in a distributed consensus protocol must come to agreement regarding values, and once that decision is reached, that choice is final.

Distributed Consensus Algorithms often take the form of a replicated state machine and log. Each state machine accepts inputs from its log, and represents the value(s) to be replicated, for example, a hash table. They allow a collection of machines to work as a coherent group that can survive the failures of some of its members.

Two well known Distributed Consensus Algorithms are Paxos and Raft. Paxos is used in systems like Chubby by Google, and Raft is used in things like tikv or etcd. Raft is generally seen as a more understandable and simpler to implement than Paxos.

Design

Raft replicates the state machine through logs. If you can ensure that all the machines have the same sequence of logs, after applying all logs in order, the state machine will reach a consistent state.

A complete Raft model contains 4 essential parts:

  1. Consensus Module, the core consensus algorithm module;

  2. Log, the place to keep the Raft logs;

  3. State Machine, the place to save the user data;

  4. Transport, the network layer for communication.

The design of the Raft crate

Note: This Raft implementation in Rust includes the core Consensus Module only, not the other parts. The core Consensus Module in the Raft crate is customizable, flexible, and resilient. You can directly use the Raft crate, but you will need to build your own Log, State Machine and Transport components.

Using the raft crate

You can use raft with either rust-protobuf or Prost to encode/decode gRPC messages. We use rust-protobuf by default. To use Prost, build (or depend on) Raft using the prost-codec feature and without default features.

Developing the Raft crate

Raft is built using the latest version of stable Rust, using the 2018 edition. Minimum supported version is 1.44.0.

Using rustup you can get started this way:

rustup component add clippy
rustup component add rustfmt

In order to have your PR merged running the following must finish without error:

cargo test --all && \
cargo clippy --all --all-targets -- -D clippy::all   && \
cargo fmt --all -- --check

You may optionally want to install cargo-watch to allow for automated rebuilding while editing:

cargo watch -s "cargo check"

Modifying Protobufs

See instructions in the proto subdirectory.

Benchmarks

We use Criterion for benchmarking.

It's currently an ongoing effort to build an appropriate benchmarking suite. If you'd like to help out please let us know! Interested?

You can run the benchmarks by installing gnuplot then running:

cargo bench

You can check target/criterion/report/index.html for plots and charts relating to the benchmarks.

You can check the performance between two branches:

git checkout master
cargo bench --bench benches -- --save-baseline master
git checkout other
cargo bench --bench benches -- --baseline master

This will report relative increases or decreased for each benchmark.

Acknowledgments

Thanks etcd for providing the amazing Go implementation!

Projects using the Raft crate

  • TiKV, a distributed transactional key value database powered by Rust and Raft.

Links for Further Research

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].