Skip to main content
networking

gRPC vs REST

9 min read
Fully authored

Protobuf + HTTP/2 streaming vs JSON + HTTP/1.1 — when each wins.

Two dominant RPC styles for microservice communication. gRPC uses Protobuf over HTTP/2 with code-generated clients. REST uses JSON over HTTP/1.1 (or 2) with hand-written clients or OpenAPI. The right choice depends on WHO consumes the API.

DimgRPCREST
Wire formatProtobuf (binary)JSON (text)
Size for user object~40 bytes~200 bytes
Latency (LAN)~1-3 ms~5-10 ms
StreamingNative (bidi, server, client)SSE or WebSocket
Browser supportVia grpc-web (limited)Universal
Client codegenRequired + easyManual or OpenAPI
Debug toolsgrpcurl, BloomRPCcurl, browser devtools
Best forInternal microservice-to-microservicePublic APIs, browser clients

The senior insight — two-tier API is the winning pattern

Public tier: REST/JSON at the gateway. Simple, browser-friendly, debuggable. Internal tier: gRPC between microservices. Fast, typed, streaming. This is what Google, Netflix, Uber all do.

Practice what you just read

Every foundation concept has a companion quiz to close the loop.