# baidu/braft

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

Repository: https://github.com/baidu/braft
Canonical: https://ross.abutalabs.com/products/braft
Language: C++
License: Apache-2.0
License Family: permissive
Topics: raft-consensus-algorithm, raft, raft-protocol, raft-cpp, raft-cxx, distributed-storage, distributed-consensus, state-machine-replication
Last push: 2024-10-25T07:22:09+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 3129, "days_push": 677, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4228, forks 924 (observed 2026-08-28T04:08:39.401565+00:00)

## What it is
braft is an industrial-grade C++ implementation of the RAFT consensus algorithm and replicated state machine, built on top of brpc. It is designed for high-throughput, low-latency scenarios and is widely used inside Baidu to build highly-available distributed systems such as storage engines, SQL clusters, and metadata services.

## Use cases
- build a highly-available distributed key-value store
- implement leader election and log replication for a distributed system
- replicate state across nodes for fault tolerance
- build a metadata or lock service with strong consistency
- add consensus to a NewSQL or distributed transaction system

## When to choose
- you need production-proven RAFT consensus in C++ with high performance
- your stack already uses brpc or Baidu infrastructure
- you are building distributed storage, SQL, or meta services requiring strong consistency

## When to avoid
- you need a consensus library in another language like Go, Java, or Rust
- you want a batteries-included distributed database rather than a consensus library
- your project cannot take a brpc dependency

## Facets
- artifact type: library
- maturity: stable
- function: concurrency, networking, rpc, developer-tools
- domain: microservices, databases, infrastructure-as-code, backend
- platform: cpp
- tags: raft-consensus, replicated-state-machine, brpc, high-availability, distributed-storage, linux, macos

## Member repositories
- baidu/braft (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:39.401565+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:22:21.471255+00:00, confidence not recorded.
  - readme: https://github.com/baidu/braft (fetched 2026-08-28T04:08:39.401565+00:00, sha 0761ebf863bf)
- Data as of 2026-08-30T08:39:29.467469+00:00.
