Backend Development 8 min read

tRPC Open‑Source RPC Framework: Architecture, Plugins, and Performance Overview

tRPC is an open‑source, plugin‑based RPC framework that separates core communication, service‑governance, and invocation layers, supports extensible codecs, naming, config, metrics, logging and tracing plugins, offers an Admin API, and demonstrates high throughput and low tail latency in cloud‑native deployments.

Tencent Cloud Developer
Tencent Cloud Developer
Tencent Cloud Developer
tRPC Open‑Source RPC Framework: Architecture, Plugins, and Performance Overview

In the early days of the Internet, diverse business scenarios and rapid trial‑and‑error cycles led to a wide variety of backend service stacks, including different programming languages, frameworks, communication protocols, service‑governance systems, and operation platforms.

As business scales, cross‑business collaboration and frequent organizational adjustments increase the cost of interoperability. The lack of a unified development framework, especially inconsistent service‑governance components, hampers efficiency.

With the rise of cloud‑native technologies, many services increasingly rely on open‑source components. Embracing cloud‑native has become a mainstream trend. tRPC was created in this context to provide an open, extensible, and plugin‑based RPC framework.

The overall architecture consists of a core framework and a set of plugins. The core is divided into three layers:

Communication Layer: Handles data transmission and protocol encoding/decoding. Built‑in support for TCP, UDP, and a Protocol Buffers‑based tRPC protocol. Additional protocols can be added via Codec plugins.

Service‑Governance Layer: Abstracts governance functions (service discovery, load balancing, monitoring, tracing, etc.) as plugins that integrate with external governance systems.

Invocation Layer: Wraps service and proxy objects, providing RPC call interfaces that support synchronous, asynchronous, one‑way, and streaming calls.

Plugins act as bridges between the core and external components. The framework adopts an interface‑based plugin factory together with AOP‑style interceptor Filters. This design enables insertion of custom logic such as validation, request replay, fault injection, or governance features (metrics, tracing, logging, authentication) without modifying the core.

Typical plugin categories include:

Codec: Protocol encoding/decoding, serialization, compression extensions.

Naming: Service registration, discovery, load balancing, circuit breaking, etc.

Config: Configuration loading from files or remote config centers, supporting hot‑reload and watch.

Metrics: Single‑dimensional (Counter, Gauge) and multi‑dimensional metric reporting.

Logging: Unified logging interfaces with extensible back‑ends.

Tracing: Distributed tracing integration.

Telemetry: Combined tracing, metrics, and logging capabilities.

tRPC also provides an Admin API for service management.

Performance testing (run on a Tencent Cloud SA2 CVM with AMD EPYC™ Rome 8‑core, 2.60 GHz, 16 GB RAM) shows:

Throughput test: QPS measured when P99 latency is around 10 ms.

Tail‑latency test: With a fixed 10 k req/s load and 1 % of requests experiencing a 5 ms tail, the impact on normal request latency is evaluated. tRPC has been used internally at Tencent for over four years and is now open‑source, supporting multiple languages (Java, Python, Node) and a rich ecosystem of cloud‑native plugins (e.g., Consul, Prometheus, OpenTelemetry). The project’s official website and repositories are: Website: https://trpc.group/ GitHub main repo: https://github.com/trpc-group GitHub plugin ecosystem: https://github.com/trpc-ecosystem

cloud-nativemicroservicesBackend DevelopmentRPCPlugin ArchitecturePerformance BenchmarktRPC
Tencent Cloud Developer
Written by

Tencent Cloud Developer

Official Tencent Cloud community account that brings together developers, shares practical tech insights, and fosters an influential tech exchange community.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.