
고성능 분산 시스템 구축을 위한 산업용 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, consistent hashing)를 포함한 컴포넌트를 커스터마이즈합니다.
# 사용해 보기!
* bRPC를 어디에 사용할 수 있는지와 장점을 알아보려면 [개요](https://github.com/apache/brpc/blob/master/docs/en/overview.md)를 읽어 보세요.
* 빌드 단계는 [시작하기](https://github.com/apache/brpc/blob/master/docs/en/getting_started.md)를 읽고 [예제](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 트레이서](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)
* [자동 동시성 제한기](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)를 참조하시기 바랍니다.