consensus-yaraft is a library for distributed, strong consistent, highly replicated log storage. It's based on yaraft, which is an implementation of the Raft protocol.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
apps/memkv
brpc @ 873fbb5
cmake_modules
include/consensus
src
yaraft @ ba4750b
.clang-format
.gitignore
.gitmodules
.travis.yml
CMakeLists.txt
LICENSE
README.md
build_brpc.sh
clang-format.sh
compile_proto.sh
deps_definitions.sh
install_dependencies.sh
run.sh

README.md

consensus-yaraft

Build Status

consensus-yaraft is an embeddable distributed log storage library that provides strong consistency based on the Raft algorithm.

Features

  • Fault tolerance & Strong consistency: every single log will be synchronously replicated through the Raft state machine. Failure of minority doesn't impede progress.
  • Multi Raft: A process creates 100 raft nodes doesn't have to create 100 threads. The background timer, the disk io thread pool (ReadyFlusher), even the FSM task queue, can be shared between raft nodes.
  • Simple: the basic operation for writing a slice of log includes only ReplicatedLog::Write.

Limitation

  • The library doesn't provide with client-interaction support.
  • Writes can only be applied to the leader. Any write operations to a non-leader will get rejected.

Installation

consensus-yaraft is written in C++11, please ensure a compiler with C++11 support is installed.

Ensure you have cmake, unzip, libtool, autoconf installed on your system.

Ensure you have leveldb, zlib, openssl installed, because brpc relies on them.

On Ubuntu 14.04

sudo apt install zlib1g-dev libboost-all-dev libsnappy-dev
bash install_dependencies.sh
bash compile_proto.sh
bash run.sh build

Once the building becomes success, the library would be installed in the directory output/.

Internals

For more details about the architecture and design of consensus-yaraft, please read this article. Currently we relies on brpc to implement network communication.

MemKV

apps/memkv is a prototype of using consensus-yaraft to implement a raft-based in-memory key-value store.

License

consensus-yaraft is under the Apache 2.0 license. See the LICENSE file for details.