Skip to content

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

Notifications You must be signed in to change notification settings

Kerollmops/canonical-raft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages