What Is gRPC? A Practical Introduction
gRPC is a high-performance RPC (Remote Procedure Call) framework built on HTTP/2, using Protocol Buffers as its default message format instead of JSON. Where REST models resources and GraphQL models a query language, gRPC models something closer to calling a function on another machine — you call a named method with typed arguments and get a typed response back.
Protocol Buffers
A gRPC service is defined in a .proto file — a strict, language-neutral
schema describing every service, method, and message shape:
service UserService {
rpc GetUser (GetUserRequest) returns (User);
}
message GetUserRequest {
string id = 1;
}
message User {
string id = 1;
string name = 2;
}
Messages are serialized to a compact binary format rather than JSON text — smaller payloads and faster parsing, at the cost of not being human-readable on the wire the way a REST or GraphQL response is.
The Four Call Types
gRPC supports more than simple request/response:
- Unary — one request, one response. The direct equivalent of a REST call.
- Server streaming — one request, a stream of responses. Useful for something like “send me every update as it happens” without the client re-requesting.
- Client streaming — a stream of requests, one final response. Useful for uploading data in chunks and getting a single confirmation.
- Bidirectional streaming — both sides stream independently over the same connection, closer in spirit to a WebSocket than to a single request/response exchange.
Why gRPC
- Performance — binary encoding plus HTTP/2 multiplexing (many calls over one connection, no head-of-line blocking) makes gRPC noticeably faster than REST/JSON for high-volume, service-to-service traffic.
- Strict contracts — the
.protofile is the source of truth; client and server code can both be generated from it, so a mismatched field name is a compile-time problem, not a runtime surprise. - Built-in streaming — REST has no native concept of a stream; gRPC does, without bolting on a separate protocol.
The tradeoff: gRPC isn’t natively browser-friendly (the wire format needs a translating proxy for browser clients), and the binary format means you can’t just read a response in plain text the way you can with REST or GraphQL — you need the schema to make sense of it.
Server Reflection
Calling a gRPC service normally requires its .proto file. Server
reflection is an optional gRPC service that lets a client ask the server
directly “what services and methods do you expose?” — useful for tooling
that wants to explore an API without every caller needing the source
.proto file shipped to them separately.
Testing gRPC in HTTP Titan
HTTP Titan can browse a gRPC server’s services and methods via reflection
with no .proto file needed, or you can upload a .proto file manually
for servers that don’t expose reflection. All four call types are
supported — unary, server streaming, client streaming, and bidirectional —
along with TLS, including mutual TLS with a client certificate and a
custom CA when a server requires it.