explaingit

apache/brpc

Analysis updated 2026-06-24

17,501C++Audience · developerComplexity · 5/5LicenseSetup · hard

TLDR

Industrial-grade C++ RPC framework from Baidu that speaks many protocols on one port, supports sync/async clients, load balancing, and RAFT-based high availability.

Mindmap

mindmap
  root((brpc))
    Inputs
      Service definitions
      Protobuf schemas
      Client requests
    Outputs
      RPC responses
      Built-in debug pages
      Profiler reports
    Use Cases
      Build high-QPS backends
      Run multi-protocol servers
      Cluster with RAFT
    Tech Stack
      C++
      Protobuf
      gRPC
      HTTP
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build a high-QPS C++ backend that exposes HTTP, gRPC, and Redis on a single port

USE CASE 2

Add RAFT-based replication to a stateful service using the bundled braft library

USE CASE 3

Profile and debug a running C++ service through bRPC built-in HTTP debug pages

USE CASE 4

Migrate an existing gRPC C++ service to bRPC for higher throughput

What is it built with?

C++ProtobufgRPCHTTPThriftRAFT

How does it compare?

apache/brpcupx/upxmicrosoft/cntk
Stars17,50117,46817,597
LanguageC++C++C++
Setup difficultyhardeasyhard
Complexity5/52/55/5
Audiencedeveloperdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1h+

Needs a C++ build toolchain plus protobuf, gflags, leveldb, and openssl as dependencies.

Apache 2.0 lets you use and ship the code in commercial products, modify it freely, and grants a patent license, as long as you preserve the notice file.

In plain English

bRPC (which stands for "better RPC") is an industrial-grade framework for building networked services in C++. RPC stands for Remote Procedure Call, a way for one computer program to call a function or service running on a different machine over a network, as if it were a local function call. bRPC is designed for high-performance systems like search engines, storage systems, machine learning infrastructure, advertising platforms, and recommendation systems. The framework is notable for its breadth of protocol support. A single server built with bRPC can speak many different communication protocols on the same port, including standard HTTP and HTTPS, the modern HTTP/2 standard, gRPC (Google's popular RPC format), Redis, Memcached, Thrift, and a range of protocols developed internally at Baidu (where the project originated). This flexibility means you can expose one service to many different types of clients without running separate servers. On the client side, bRPC supports synchronous calls (wait for the response before continuing), asynchronous calls (send the request and continue doing other work), and hybrid patterns. It also supports distributed system features like load balancing (distributing requests across multiple servers) and high-availability clustering using the RAFT consensus algorithm, a technique for keeping data consistent across a group of servers even when some fail. Built-in debugging tools let you inspect running services via HTTP, and profilers help identify where your program is spending time or memory. bRPC is written in C++ and is now maintained under the Apache Software Foundation.

Copy-paste prompts

Prompt 1
Walk me through writing a minimal bRPC echo server and client in C++ using protobuf
Prompt 2
Show me how to configure bRPC load balancing across a list of backend addresses
Prompt 3
Help me wire braft into a key-value service so writes survive a leader crash
Prompt 4
Compare bRPC vs gRPC C++ for a search backend with 100k QPS

Frequently asked questions

What is brpc?

Industrial-grade C++ RPC framework from Baidu that speaks many protocols on one port, supports sync/async clients, load balancing, and RAFT-based high availability.

What language is brpc written in?

Mainly C++. The stack also includes C++, Protobuf, gRPC.

What license does brpc use?

Apache 2.0 lets you use and ship the code in commercial products, modify it freely, and grants a patent license, as long as you preserve the notice file.

How hard is brpc to set up?

Setup difficulty is rated hard, with roughly 1h+ to a first successful run.

Who is brpc for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub apache on gitmyhub

Verify against the repo before relying on details.