GitXplorerGitXplorer
K

canonical-raft

public
9 stars
0 forks
3 issues

Commits

List of commits on branch master.
Verified
346e645199783595bcdc8332d715f574a2b19184

Update the canonical-raft fork submodule

KKerollmops committed 5 years ago
Verified
98319fbeabdd4a578d9ebf24f2dc9d264eb3e01a

Use a custom forked version of libuv-sys2

KKerollmops committed 5 years ago
Verified
484bed292ff4da342857ed677ebdd4730a04c63d

Fix the submodule source

KKerollmops committed 5 years ago
Verified
bbeb566c478f913fe92baa9a292f4d3fd272edc2

Add an introduction to the library

KKerollmops committed 5 years ago
Verified
dfd6f404ed3e9738692d245c275fa0504100a3ce

Link the plans issues in the README

KKerollmops committed 5 years ago
Verified
104c064324cf23acb69af3835331c404d1dd1959

Use a fork of the libuv-sys2 dependency

KKerollmops committed 5 years ago

README

The README file for this repository.

canonical-raft

The, not released yet, simplest Rust library to replicate anything over the network.

Why This Library?

The rust replication ecosystem is hard to use

There is many replication libraries in the Rust ecosystem but is there any one that is easy enough to use that anybody achieved to use it? And somebody that is not already the author of the replication library itself?

I don't think so!

Just look at the complexity of use of the most popular Raft library developped by PingCAP:

  1. You have to manage the Raft logic yourself, in your own loop.
  2. You have to deal with the Protocol Buffer messages.

I am jealous of the Go replication ecosystem

Yes, I am talking about the Go programming language here, and more particularly about state replication over the network. The most popular library for replicating states is the HashiCorp one and why?

Look how easy it is:

  1. You just have to follow the FSM interface.
  2. Your state will be replicated any time you call raft.Apply.

That is just pure magic 🧙‍♀️💫

About the wrapped canonical raft library

The canonical raft library was mostly inspired by the HashiCorp one, and therefore inhertis its simple interface where only three functions can be implemented.

This is why we must wrap it in the safest and easiest way as possible to make the Rust community proud of its replication ecosystem!

Current Limitations

Canonical-raft is based on the raft library developed by canonical and the most important limitation is that it requires Linux. This limitation is due to the fact that it uses the AIO API for disk I/O, which is only available on Linux, a pull request is opened to remove this limitation.

One other restraining element is that the currently provided raft_io runtime is based on libuv which is not the commonly used asynchronous runtime we use in the Rust community.

Plans for canonical-raft

  1. [ ] #1 Create a safe abstraction on top of the bindings from canonical-raft-sys.
  2. [ ] #2 Create a raft_io interface that could run on top of any async runtime.
  3. [ ] #3 Create a canonical-raft-mdb akin to the MDBstore of HashiCorp.

Installation

This is a Rust library, you must make sure to have the toolchain installed.

As it's explained above, canonical-raft depends on the raft library developed by canonical and it works with libuv.

apt install pkg-config libuv1-dev gcc make
git submodule update --init --recursive
cargo build

Note that it is highly recommended to run this library in release mode, for performances reasons.

cargo build --release