
高性能な分散システムを構築するための産業グレードのC++ RPCフレームワーク。複数のプロトコル(HTTP、gRPC、Redis、Thrift)をサポートし、ロードバランシング、ネーミングサービス、RAFTコンセンサスを内蔵。
[中文版](https://github.com/apache/brpc/blob/master/README_cn.md)
[](https://github.com/apache/brpc/actions/workflows/ci-linux.yml)
[](https://github.com/apache/brpc/actions/workflows/ci-macos.yml)


[bRPC](https://brpc.apache.org/) は C++ 言語を使用した産業グレードの RPC フレームワークであり、検索、ストレージ、機械学習、広告、レコメンデーションなどの高性能システムでよく使用されます。
### 「bRPC」は「better RPC」を意味します。
以下の用途に使用できます:
* 複数のプロトコルで通信できるサーバーを構築する(**同一ポート上で**)、またはあらゆる種類のサービスにアクセスする:
* restful http/https、[h2](https://httpwg.org/specs/rfc9113.html)/[gRPC](https://grpc.io)。bRPC での http/h2 の使用は [libcurl](https://curl.haxx.se/libcurl/) よりもはるかに扱いやすいです。HTTP/h2+json を使用して protobuf ベースのプロトコルにアクセスでき、おそらく別の言語からも可能です。
* [redis](https://github.com/apache/brpc/blob/master/docs/en/redis_client.md) と [memcached](https://github.com/apache/brpc/blob/master/docs/en/memcache_client.md)、スレッドセーフで、公式クライアントよりも扱いやすく高性能です。
* [rtmp](https://github.com/apache/brpc/blob/master/src/brpc/rtmp.h)/[flv](https://en.wikipedia.org/wiki/Flash_Video)/[hls](https://en.wikipedia.org/wiki/HTTP_Live_Streaming)、[ストリーミングサービス](https://github.com/brpc/media-server)の構築用。
* hadoop_rpc(オープンソース化される可能性あり)。
* [rdma](https://en.wikipedia.org/wiki/Remote_direct_memory_access) サポート。
* [thrift](https://github.com/apache/brpc/blob/master/docs/en/thrift.md) サポート、スレッドセーフで、公式クライアントよりも扱いやすく高性能です。
* Baidu で使用されているあらゆる種類のプロトコル:[baidu_std](https://github.com/apache/brpc/blob/master/docs/en/baidu_std.md)、[streaming_rpc](https://github.com/apache/brpc/blob/master/docs/en/streaming_rpc.md)、hulu_pbrpc、[sofa_pbrpc](https://github.com/baidu/sofa-pbrpc)、nova_pbrpc、public_pbrpc、ubrpc および nshead ベースのもの。
* [braft](https://github.com/brpc/braft) でオープンソース化されている産業グレードの [RAFT コンセンサスアルゴリズム](https://raft.github.io)実装を使用して、[HA](https://en.wikipedia.org/wiki/High_availability) 分散サービスを構築する。
* サーバーはリクエストを[同期的](https://github.com/apache/brpc/blob/master/docs/en/server.md)または[非同期的](https://github.com/apache/brpc/blob/master/docs/en/server.md#asynchronous-service)に処理できます。
* クライアントはサーバーに[同期的](https://github.com/apache/brpc/blob/master/docs/en/client.md#synchronus-call)、[非同期的](https://github.com/apache/brpc/blob/master/docs/en/client.md#asynchronous-call)、[半同期的](https://github.com/apache/brpc/blob/master/docs/en/client.md#semi-synchronous-call)にアクセスするか、[コンボチャネル](https://github.com/apache/brpc/blob/master/docs/en/combo_channel.md)を使用してシャーディングや並列アクセスを宣言的に簡素化できます。
* [http 経由で](https://github.com/apache/brpc/blob/master/docs/en/builtin_service.md)サービスをデバッグし、[cpu](https://github.com/apache/brpc/blob/master/docs/en/cpu_profiler.md)、[heap](https://github.com/apache/brpc/blob/master/docs/en/heap_profiler.md)、[contention](https://github.com/apache/brpc/blob/master/docs/en/contention_profiler.md) プロファイラを実行する。
* [より良いレイテンシとスループット](https://github.com/apache/brpc/blob/master/docs/en/overview.md#better-latency-and-throughput)を実現する。
* 組織で使用されているプロトコルで [bRPC を迅速に拡張](https://github.com/apache/brpc/blob/master/docs/en/new_protocol.md)する、または[ネーミングサービス](https://github.com/apache/brpc/blob/master/docs/en/load_balancing.md)(dns、zk、etcd など)、[ロードバランサー](https://github.com/apache/brpc/blob/master/docs/en/load_balancing.md)(rr、random、コンシステントハッシュ)などのコンポーネントをカスタマイズする。
# 試してみる!
* bRPC をどこで使えるか、その利点を知るには [overview](https://github.com/apache/brpc/blob/master/docs/en/overview.md) をお読みください。
* ビルド手順については [getting started](https://github.com/apache/brpc/blob/master/docs/en/getting_started.md) をお読みいただき、[examples](https://github.com/apache/brpc/tree/master/example/) で試してみてください。
* ドキュメント:
* [FlatBuffers RPC を有効化し、サンプルを検証する](https://github.com/apache/brpc/blob/master/docs/en/flatbuffers.md)
* [パフォーマンスベンチマーク](https://github.com/apache/brpc/blob/master/docs/en/benchmark.md)
* [bvar](https://github.com/apache/brpc/blob/master/docs/en/bvar.md)
* [bvar_c++](https://github.com/apache/brpc/blob/master/docs/en/bvar_c%2B%2B.md)
* [bthread](https://github.com/apache/brpc/blob/master/docs/en/bthread.md)
* [bthread を使うべきか否か](https://github.com/apache/brpc/blob/master/docs/en/bthread_or_not.md)
* [thread-local](https://github.com/apache/brpc/blob/master/docs/en/thread_local.md)
* [実行キュー](https://github.com/apache/brpc/blob/master/docs/en/execution_queue.md)
* [bthread tracer](https://github.com/apache/brpc/blob/master/docs/en/bthread_tracer.md)
* [bthread タグ付きタスクグループ](https://github.com/apache/brpc/blob/master/docs/en/bthread_tagged_task_group.md)
* クライアント
* [基本](https://github.com/apache/brpc/blob/master/docs/en/client.md)
* [エラーコード](https://github.com/apache/brpc/blob/master/docs/en/error_code.md)
* [コンボチャネル](https://github.com/apache/brpc/blob/master/docs/en/combo_channel.md)
* [http/h2 へのアクセス](https://github.com/apache/brpc/blob/master/docs/en/http_client.md)
* [gRPC へのアクセス](https://github.com/apache/brpc/blob/master/docs/en/http_derivatives.md#h2grpc)
* [thrift へのアクセス](https://github.com/apache/brpc/blob/master/docs/en/thrift.md#client-accesses-thrift-server)
* [UB へのアクセス](https://github.com/apache/brpc/blob/master/docs/en/ub_client.md)
* [ストリーミング RPC](https://github.com/apache/brpc/blob/master/docs/en/streaming_rpc.md)
* [redis へのアクセス](https://github.com/apache/brpc/blob/master/docs/en/redis_client.md)
* [memcached へのアクセス](https://github.com/apache/brpc/blob/master/docs/en/memcache_client.md)
* [バックアップリクエスト](https://github.com/apache/brpc/blob/master/docs/en/backup_request.md)
* [ダミーサーバー](https://github.com/apache/brpc/blob/master/docs/en/dummy_server.md)
* サーバー
* [基本](https://github.com/apache/brpc/blob/master/docs/en/server.md)
* [http/h2 の提供](https://github.com/apache/brpc/blob/master/docs/en/http_service.md)
* [gRPC の提供](https://github.com/apache/brpc/blob/master/docs/en/http_derivatives.md#h2grpc)
* [thrift の提供](https://github.com/apache/brpc/blob/master/docs/en/thrift.md#server-processes-thrift-requests)
* [Nshead の提供](https://github.com/apache/brpc/blob/master/docs/en/nshead_service.md)
* [サーバー問題のデバッグ](https://github.com/apache/brpc/blob/master/docs/en/server_debugging.md)
* [サーバープッシュ](https://github.com/apache/brpc/blob/master/docs/en/server_push.md)
* [アバランシェ](https://github.com/apache/brpc/blob/master/docs/en/avalanche.md)
* [自動 ConcurrencyLimiter](https://github.com/apache/brpc/blob/master/docs/en/auto_concurrency_limiter.md)
* [メディアサーバー](https://github.com/brpc/media-server)
* [json2pb](https://github.com/apache/brpc/blob/master/docs/en/json2pb.md)
* [組み込みサービス](https://github.com/apache/brpc/blob/master/docs/en/builtin_service.md)
* [status](https://github.com/apache/brpc/blob/master/docs/en/status.md)
* [vars](https://github.com/apache/brpc/blob/master/docs/en/vars.md)
* [connections](https://github.com/apache/brpc/blob/master/docs/en/connections.md)
* [flags](https://github.com/apache/brpc/blob/master/docs/en/flags.md)
* [rpcz](https://github.com/apache/brpc/blob/master/docs/en/rpcz.md)
* [cpu_profiler](https://github.com/apache/brpc/blob/master/docs/en/cpu_profiler.md)
* [heap_profiler](https://github.com/apache/brpc/blob/master/docs/en/heap_profiler.md)
* [contention_profiler](https://github.com/apache/brpc/blob/master/docs/en/contention_profiler.md)
* ツール
* [rpc_press](https://github.com/apache/brpc/blob/master/docs/en/rpc_press.md)
* [rpc_replay](https://github.com/apache/brpc/blob/master/docs/en/rpc_replay.md)
* [rpc_view](https://github.com/apache/brpc/blob/master/docs/en/rpc_view.md)
* [benchmark_http](https://github.com/apache/brpc/blob/master/docs/en/benchmark_http.md)
* [parallel_http](https://github.com/apache/brpc/blob/master/docs/en/parallel_http.md)
* その他
* [IOBuf](https://github.com/apache/brpc/blob/master/docs/en/iobuf.md)
* [ストリーミングログ](https://github.com/apache/brpc/blob/master/docs/en/streaming_log.md)
* [FlatMap](https://github.com/apache/brpc/blob/master/docs/en/flatmap.md)
* [コルーチン](https://github.com/apache/brpc/blob/master/docs/en/coroutine.md)
* [サーキットブレーカー](https://github.com/apache/brpc/blob/master/docs/en/circuit_breaker.md)
* [UBRing](https://github.com/apache/brpc/blob/master/docs/en/ubring.md)
* [RDMA](https://github.com/apache/brpc/blob/master/docs/en/rdma.md)
* [Bazel サポート](https://github.com/apache/brpc/blob/master/docs/en/bazel_support.md)
* [Wireshark baidu_std ディセクタプラグイン](https://github.com/apache/brpc/blob/master/docs/en/wireshark_baidu_std.md)
* [bRPC 入門](https://github.com/apache/brpc/blob/master/docs/cn/brpc_intro.pptx)(トレーニング資料)
* [大規模サービス構築のチュートリアル](https://github.com/apache/brpc/blob/master/docs/en/tutorial_on_building_services.pptx)(トレーニング資料)
* [bRPC の内部](https://github.com/apache/brpc/blob/master/docs/en/brpc_internal.pptx)(トレーニング資料)
* RPC の詳細
* [新しいプロトコル](https://github.com/apache/brpc/blob/master/docs/en/new_protocol.md)
* [アトミック命令](https://github.com/apache/brpc/blob/master/docs/en/atomic_instructions.md)
* [IO](https://github.com/apache/brpc/blob/master/docs/en/io.md)
* [スレッディングの概要](https://github.com/apache/brpc/blob/master/docs/en/threading_overview.md)
* [負荷分散](https://github.com/apache/brpc/blob/master/docs/en/load_balancing.md)
* [局所性を考慮した負荷分散](https://github.com/apache/brpc/blob/master/docs/en/lalb.md)
* [コンシステントハッシュ](https://github.com/apache/brpc/blob/master/docs/en/consistent_hashing.md)
* [メモリ管理](https://github.com/apache/brpc/blob/master/docs/en/memory_management.md)
* [タイマーの保持](https://github.com/apache/brpc/blob/master/docs/en/timer_keeping.md)
* [bthread_id](https://github.com/apache/brpc/blob/master/docs/en/bthread_id.md)
* ユースケース
* [ユーザー事例](https://github.com/apache/brpc/blob/master/community/cases.md)
# コードへの貢献
[こちら](https://github.com/apache/brpc/blob/master/CONTRIBUTING.md)を参照してください。
# フィードバックと参加
* バグの報告、質問、提案は [Github Issues](https://github.com/apache/brpc/issues) からお願いします。
* メーリングリスト([email protected])を購読して、プロジェクトの最新情報を受け取ってください。
# 行動規範
私たちは Apache Software Foundation の行動規範に従っています。詳細はこちらをご参照ください [リンク](https://www.apache.org/foundation/policies/conduct)。