Back to roadmap
Module 5 · APIs & Application LayerDay 04125 min

gRPC and Protobuf

Strongly typed, binary, fast — and the default for service-to-service.

Day 041

gRPC and Protobuf

Client
client
Server
service
.proto
note
Signal path
gRPC over HTTP/2 with protobuf
Client
client
HTTP/2 + protob...
Server
service
.proto
note
async
Client
client
.proto
note
async
Server
service
Memory hook

gRPC and Protobuf: strongly typed, binary, fast

Mental model

turn boundaries into contracts

Design lens

Browser support is limited; needs proxy.

Recall anchors
WireStreamsUse

Why it matters

gRPC uses Protocol Buffers as its IDL and binary wire format, transported over HTTP/2. It's compact, type-safe, supports streaming, and is the default for internal microservice calls in many companies.

Deep dive

Schema-first: .proto files generate clients and servers in many languages.

Streaming: unary (request/response), server stream, client stream, bidirectional.

Pick gRPC for internal latency-sensitive calls; REST/JSON for public APIs and browser clients (gRPC-Web exists but is more constrained).

Demo / scenario

Replace internal REST call with gRPC.

  1. Define service in .proto.
  2. Generate stubs.
  3. Wire payloads ~3× smaller; latency drops a few ms.
  4. Add bidi streaming for live updates.

Tradeoffs

  • Browser support is limited; needs proxy.
  • Binary payloads are harder to debug ad-hoc.
  • Schema evolution rules are stricter — practice them.

Diagram

HTTP/2 + protobuf
Client
Server
.proto
gRPC over HTTP/2 with protobuf.

Mind map

Check yourself

Loading quiz…

Sources & further reading