baidu/braft

An industrial-grade C++ implementation of RAFT consensus algorithm based on brpc, widely used inside Baidu to build highly-available distributed systems.

C++

4,230

651 commits

updated Oct 25, 2024

See the code

README

Build Status


Overview

An industrial-grade C++ implementation of RAFT consensus algorithm and replicated state machine based on brpc. braft is designed and implemented for scenarios demanding for high workload and low overhead of latency, with the consideration for easy-to-understand concepts so that engineers inside Baidu can build their own distributed systems individually and correctly.

It's widely used inside Baidu to build highly-available systems, such as:

  • Storage systems: Key-Value, Block, Object, File ...
  • SQL storages: HA MySQL cluster, distributed transactions, NewSQL systems ...
  • Meta services: Various master modules, Lock services ...

Getting Started

  • Build brpc which is the main dependency of braft.

  • Compile braft with cmake

    $ mkdir bld && cd bld && cmake .. && make
    
  • Play braft with examples.

  • Installing from vcpkg

    You can download and install braft using the vcpkg dependency manager:

    git clone https://github.com/Microsoft/vcpkg.git
    cd vcpkg
    ./bootstrap-vcpkg.sh
    ./vcpkg integrate install
    ./vcpkg install braft
    

    The braft port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

Docs

Discussion

  • Add Weixin id zhengpf__87 or xiongk_2049 with a verification message 'braft', then you will be invited into the discussion group.
distributed-consensus
distributed-storage
raft
raft-consensus-algorithm
raft-cpp
raft-cxx
raft-protocol
state-machine-replication

baidu/braft

An industrial-grade C++ implementation of RAFT consensus algorithm based on brpc, widely used inside Baidu to build highly-available distributed systems.

C++

4,230

651 commits

updated Oct 25, 2024

See the code

README

Build Status


Overview

An industrial-grade C++ implementation of RAFT consensus algorithm and replicated state machine based on brpc. braft is designed and implemented for scenarios demanding for high workload and low overhead of latency, with the consideration for easy-to-understand concepts so that engineers inside Baidu can build their own distributed systems individually and correctly.

It's widely used inside Baidu to build highly-available systems, such as:

  • Storage systems: Key-Value, Block, Object, File ...
  • SQL storages: HA MySQL cluster, distributed transactions, NewSQL systems ...
  • Meta services: Various master modules, Lock services ...

Getting Started

  • Build brpc which is the main dependency of braft.

  • Compile braft with cmake

    $ mkdir bld && cd bld && cmake .. && make
    
  • Play braft with examples.

  • Installing from vcpkg

    You can download and install braft using the vcpkg dependency manager:

    git clone https://github.com/Microsoft/vcpkg.git
    cd vcpkg
    ./bootstrap-vcpkg.sh
    ./vcpkg integrate install
    ./vcpkg install braft
    

    The braft port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

Docs

Discussion

  • Add Weixin id zhengpf__87 or xiongk_2049 with a verification message 'braft', then you will be invited into the discussion group.
distributed-consensus
distributed-storage
raft
raft-consensus-algorithm
raft-cpp
raft-cxx
raft-protocol
state-machine-replication

Project health

Overall

4.8/10

Maintained

0/10

Code review

10/10
OpenSSF Scorecard

Significant stargazers

(top 24 of 77)

Tao He

462 followers · starred Nov 2018

ruki

1,334 followers · starred Feb 2023

siddontang

2,981 followers · starred Aug 2018

Andy Pan

3,542 followers · starred Dec 2020