Skip to main content

gRPC

gRPC is a high-performance RPC framework using HTTP/2 and Protocol Buffers, with cross-language code generation and streaming support.

gRPC is an open-source remote procedure call (RPC) framework created at Google. It lets a client invoke methods on a remote server as if they were local functions, with the framework handling serialization, transport, and connection management.

How It Works

Service authors define methods and message types in a Protocol Buffers (.proto) file. A code generator then produces client and server stubs in many languages from that single contract. At runtime, messages are serialized to a compact binary format and sent over HTTP/2, which provides multiplexing, header compression, and bidirectional streaming on a single connection.

gRPC supports four call patterns: unary (one request, one response), server streaming, client streaming, and bidirectional streaming. Built-in features include deadlines, cancellation, authentication, and pluggable load balancing.

Why It Matters

The binary encoding and HTTP/2 transport make gRPC faster and lighter on the wire than text-based JSON over HTTP/1.1, which matters for internal service-to-service communication at scale. The shared .proto contract gives strong typing across language boundaries and makes breaking changes easier to detect.

The main limitation is browser support. Browsers cannot speak raw gRPC, so web clients use gRPC-Web through a proxy, or teams expose a REST or GraphQL edge. Binary payloads are also harder to inspect than JSON without tooling.

gRPC is a strong default for microservices that talk to each other in performance-sensitive paths. Public, browser-facing APIs often still favor REST or GraphQL for reach and cacheability.

Related Terms

gRPC relies on Protocol Buffers and HTTP/2, and is commonly contrasted with REST and GraphQL.