Skip to main content
gRPC

gRPC Remote Procedure Call

Active

High-performance, open-source RPC framework from Google using HTTP/2 for transport and Protocol Buffers for serialization. Supports unary, server streaming, client streaming, and bidirectional streaming RPCs.

RPCHTTP/2Protocol Buffers2015CNCF

In one line

gRPC is a high-performance RPC framework developed by Google and open-sourced in 2015. It uses HTTP/2 for transport, Protocol Buffers (protobuf) for serialization, and generates type-safe client/server stubs from .proto schema files. gRPC supports four service patterns: unary (request/response), server streaming, client streaming, and bidirectional streaming. It is widely used for internal microservice communication and is the protocol underlying Kubernetes API server communication, etcd, and many cloud-native systems.

Quick Reference

FieldSizeDescription
TransportHTTP/2 mandatory (h2)
SerializationvariableProtocol Buffers binary encoding
Content-Typeapplication/grpc
HTTP statusAlways 200; gRPC status in trailer Grpc-Status
Grpc-Status4 bytesgRPC status code (0 = OK, 1–16 = errors)
Grpc-MessagevariableURL-encoded error description
Length-prefix5 bytes1-byte compressed flag + 4-byte message length

Key Characteristics

Four service patterns

Unary, server streaming, client streaming, and bidirectional streaming over a single HTTP/2 connection.

Code-first schema

Services defined in .proto files. Stubs generated for 11+ languages from a single source of truth.

Binary efficiency

Protocol Buffers encoding is 5–10x smaller than JSON and significantly faster to serialize/deserialize.

Type-safe contracts

Schema enforced at compile time via generated stubs. Breaking changes caught before deployment.

Message Format

Request
http
gRPC Unary RPC over HTTP/2:

HEADERS frame:
  :method = POST
  :path = /helloworld.Greeter/SayHello
  :scheme = https
  :authority = api.example.com
  content-type = application/grpc
  te = trailers

DATA frame (length-prefixed protobuf):
  [0x00][0x00 0x00 0x00 0x0D][protobuf bytes]
   ^compressed  ^message length
Response
http
gRPC Unary Response:

HEADERS frame:
  :status = 200   content-type = application/grpc

DATA frame:
  [0x00][0x00 0x00 0x00 0x12][protobuf bytes]

HEADERS (trailers):
  grpc-status = 0
  grpc-message = (empty on success)

Implementations

linuxsince 2015third-party
macossince 2015third-party
windowssince 2015third-party
iosthird-party
androidthird-party