Skip to content
Raft core implementation as a replication library
C++ CMake Python Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Build Status codecov

Raft implementation derived from the cornerstone project, which is a very lightweight C++ implementation with minimum dependencies, originally written by Andy Chen.

New features that are not described in the original paper, but required for the real-world use cases in eBay, have been added. We believe those features are useful for others outside eBay as well.


In the original cornerstone

  • Core Raft algorithm
    • Log replication & compaction
    • Leader election
    • Snapshot
    • Dynamic membership & configuration change
  • Group commit & pipelined write
  • User-defined log store & state machine support

New features added in this project

How to Build

1. Install cmake and openssl:

  • Ubuntu
$ sudo apt-get install cmake
$ sudo apt-get install openssl libssl-dev
  • OSX
$ brew install cmake
$ brew install openssl
  • Windows
    • Download and install CMake.
    • Currently, we do not support SSL for Windows.

2. Fetch Asio library:

  • Linux & OSX
$ ./
  • Windows
    • Clone Asio into the project directory.

3. Build static library, tests, and examples:

  • Linux & OSX
$ mkdir build
$ cd build
build$ cmake ../
build$ make

Run unit tests

build$ ./
  • Windows:
C:\NuRaft> mkdir build
C:\NuRaft> cd build
C:\NuRaft\build> cmake -G "NMake Makefiles" ..\
C:\NuRaft\build> nmake

You may need to run vcvars script first in your build directory. For example (it depends on how you installed MSVC):

C:\NuRaft\build> c:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat

How to Use

Please refer to this document.

Example Implementation

Please refer to examples.


Please refer to tests/bench.

Quick Benchmark Results

Supported Platforms

  • Ubuntu (tested on 14.04, 16.04, and 18.04)
  • Centos (tested on 7)
  • OSX (tested on 10.13 and 10.14)
  • Windows (built using MSVC 2019, not thoroughly tested)

Contributing to This Project

We welcome contributions. If you find any bugs, potential flaws and edge cases, improvements, new feature suggestions or discussions, please submit issues or pull requests.


License Information

Copyright 2017-2019 eBay Inc.

Author/Developer: Jung-Sang Ahn

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

3rd Party Code

  1. URL:
    Originally licensed under the Apache 2.0 license.

  2. URL:
    Original Copyright 2011-2016 Stephan Brumme
    See Original ZLib License:

  3. URL:
    Originally licensed under the MIT license.

  4. URL:
    Originally licensed under the MIT license.

  5. URL:
    Originally licensed under the MIT license.

  6. URL:
    Copyright 2011-2012 Eric Wendelin
    Originally licensed under the Apache 2.0 license.

  7. URL:
    Copyright 2012-2017 Lars Bilke
    Originally licensed under the BSD license.

You can’t perform that action at this time.