What is gRPC

gRPC (gRPC Remote Procedure Call) is a framework created by Google for high-performance service-to-service communication. It uses Protocol Buffers for binary serialization and HTTP/2 for multiplexed transport.

How it works

You define services and messages in a .proto file. The protoc compiler generates type-safe client and server code in your language. The client calls a method that looks like a local function call; gRPC handles serialization, transport, and deserialization. The binary format is 3-10x smaller than JSON and significantly faster to parse.

gRPC supports four patterns: unary (one request, one response), server streaming (one request, many responses), client streaming (many requests, one response), and bidirectional streaming (many requests, many responses simultaneously).

Why it matters

gRPC is the standard for internal microservice communication where latency, throughput, and type safety matter more than browser compatibility. The schema-first approach with code generation catches errors at compile time. HTTP/2 multiplexing allows many concurrent RPCs on a single TCP connection. Deadlines propagate through call chains, preventing cascading timeouts.

The tradeoff: gRPC doesn't work natively in browsers (requires grpc-web proxy), the binary format is not human-readable (harder to debug), and it's more complex to set up than REST.

See How gRPC Works for Protocol Buffers, HTTP/2 multiplexing, and the four streaming patterns.