Skip to content
This repository has been archived by the owner on Jun 19, 2019. It is now read-only.

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.

License

Notifications You must be signed in to change notification settings

neverchanje/consensus-yaraft

Repository files navigation

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.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published