Skip to content
BENIBIX Learn

gRPC vs tRPC

People think tRPC is gRPC for TypeScript, and it is not. gRPC sends small binary messages between services written in many languages. tRPC sends JSON, and it only works when both ends are TypeScript and share the same types. The names differ by one letter, and the jobs differ a lot.

Development🔌 APIs

gRPC

A fast way for one service to call another. Its messages are small.

gRPC is a fast way for services to call each other's functions. Google made it and opened it to everyone in 2015. You describe each service and its messages in a .proto file. Tools turn that file into ready code for many languages. Messages are sent in a small binary format called Protocol Buffers, over HTTP/2. It is fast and strict, so firms use it between their own services.

Example
Jack's 12 back-end services talk to each other with gRPC. One .proto file keeps every service's Go and Python code in step.
Why it matters
Its messages are smaller and faster than JSON. The shared file also catches wrong fields before the code runs.
Full entry
Development🔌 APIs

tRPC

A TypeScript tool. The front end calls server code, and both share the same types.

tRPC is a TypeScript tool for building APIs where the front end and back end share types. You write a function on the server. The front end calls it as if it were a local function. If the server changes, the front end shows a type error at once. It needs no schema file and no generated code, but both sides must use TypeScript.

Example
Emma renames a field on her server. Her editor at once marks every front-end line that used the old name.
Why it matters
Mistakes between front end and back end show up while you type, not after you ship.
Full entry

In one line

gRPC
A fast way for one service to call another. Its messages are small.
tRPC
A TypeScript tool. The front end calls server code, and both share the same types.