Interview: The Story Behind Baidu’s Open‑Source RPC Framework brpc
This article interviews Baidu’s chief architect Ge Jun about the origins, design principles, performance advantages, and open‑source release of the high‑performance C++/Java RPC framework brpc, highlighting its extensive internal use, architectural features, and future roadmap.
This article, originally published on InfoQ and reprinted with permission, introduces Baidu’s open‑source RPC framework brpc.
On September 14, Baidu released brpc on GitHub under the Apache 2.0 license. brpc is a protobuf‑based RPC framework, internally called “baidu‑rpc”, supporting many third‑party protocols and currently outperforming comparable RPC products in benchmark tests.
Developed since 2014 in C++ and Java, brpc is the most widely used RPC framework inside Baidu, handling roughly 750,000 concurrent instances and supporting over 500 services such as Hadoop, Table, Mola, high‑performance computing, model training, and online search.
InfoQ: Basic information about brpc? When did development start and how has it evolved?
Ge Jun: brpc was created in 2014, has undergone about 3,000 changes, and continues to be optimized. The main languages are C++ and Java, with other language bindings (e.g., Python) wrapping the C++ implementation. brpc now supports around 750,000 concurrent instances and more than 500 services across Baidu’s infrastructure.
InfoQ: Why did Baidu develop brpc?
Ge Jun: Existing RPC solutions were no longer leading; the team, led by a former Google engineer, invested heavily in building a solid, easy‑to‑use framework that improves developer efficiency and offers good documentation, logging, changelog, versioning, and open‑source friendliness.
InfoQ: How does brpc compare with other open‑source RPC frameworks?
Ge Jun: brpc focuses on depth and usability. Unlike gRPC or Thrift, brpc provides higher reliability, ease of use, and built‑in diagnostics. It offers wait‑free reads/writes, an M:N thread library (bthread), and extensive built‑in services for monitoring and debugging. Reliability: high code quality, wait‑free I/O, and bthread for high concurrency. Usability: sensible defaults, minimal configuration required. Diagnostics: built‑in HTTP services expose latency, errors, connections, RPC traces, CPU hotspots, memory allocation, lock contention, and custom metrics via bvar.
InfoQ: Service governance considerations?
Ge Jun: brpc integrates tightly with Baidu’s internal systems (BCLOUD, Agile, BNS, Giano, NOAH). The open‑source version removes these bindings but remains customizable for name services, load balancing, and protocols.
InfoQ: Differences between brpc and the earlier sofa‑pbrpc?
More generic protocol abstraction, supporting many protocols (Protobuf, HTTP, nshead, mcpack, Redis, Memcached, RTMP, etc.) and customizable load‑balancing algorithms. Better multithreading quality, avoiding common RPC pitfalls. Comprehensive debugging and operations support via bvar and built‑in services.
InfoQ: Overall architecture?
Ge Jun: brpc’s architecture spans from transport to application layer, emphasizing extensibility without sacrificing ease of use. A single server can handle dozens of protocols, and clients can select protocols via simple string options (e.g., "http", "redis").
InfoQ: Performance and how it is achieved?
Performance is a core focus; real‑world cases (Baidu Map API, DSP, ELF learning framework, cloud proxy service) show significant latency and throughput improvements. Benchmarks comparing brpc with Thrift and gRPC are available in the documentation.
InfoQ: Why open source brpc and future plans?
Open‑sourcing brpc paves the way for other Baidu projects (e.g., a RAFT library, BigFlow) and strengthens the ecosystem. The open‑source version remains close to the internal one, with ongoing updates and community involvement.
GitHub repository: https://github.com/brpc/brpc
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Qunar Tech Salon
Qunar Tech Salon is a learning and exchange platform for Qunar engineers and industry peers. We share cutting-edge technology trends and topics, providing a free platform for mid-to-senior technical professionals to exchange and learn.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
