Lesson 1 · Foundations
What gRPC is, and why it exists
Call a method on another server as if it were local.
Your win: explain in one breath what gRPC is, why it's built on Protocol Buffers + HTTP/2, and why every internal call in your monorepo uses it instead of hand-rolled REST.
The problem: services need to call each other
spike needs media info from notification. conversationmgmt needs config from mastermgmt. The naive way is REST + JSON over HTTP/1.1: hand-write URLs, marshal JSON, hope both sides agree on the shape. Nothing enforces the contract, JSON is chatty, and HTTP/1.1 opens a connection per call. At 30+ services, that friction compounds.
gRPC's answer: a generated, typed remote call
gRPC lets a client call a method on a server on another machine as if it were
a local object.1 You declare the
service once in a .proto contract; a generator produces a typed client and
server; you just call the method. Two technologies make it work:
Protocol Buffers
The contract + payload format — a strict, versionable IDL that serializes to compact binary. Typed on both ends. (Lesson 2.)
HTTP/2
The transport — one long-lived connection multiplexing many concurrent streams, with header compression. Efficient, and it's what enables streaming. (Part 2.)
Your code already lives this
Every internal call in the monorepo is gRPC. When spike needs media, it doesn't build an HTTP request — it calls a generated method on a client stub:
internal/spike/modules/email/application/media_manager/media_info_fetcher.go:24// A remote call to the notification service — looks like a local method:
resp, err := f.client.InternalRetrieveMedia(ctx, &npb.InternalRetrieveMediaRequest{
MediaIds: mediaIDs, OrganizationId: org.OrganizationID().String(),
})
f.client is a generated npb.MediaReaderServiceClient; spike
dialed notification at startup (rsc.GRPCDial("notificationmgmt")). The
request/response types (npb.*) came from notification's
.proto. No URLs, no JSON — just a typed method call. Full map:
repo-grpc-map.md.
gRPC vs REST — the 10-second version
Rule of thumb (full comparison in Part 5): gRPC for internal service-to-service (typed, fast, streaming), REST/JSON for public or browser-facing APIs (universal, human-readable). Our repo does both — it even exposes some gRPC services as REST via a gateway (Part 5).
gRPC — "What is gRPC? Introduction" + Core concepts
The official framing (call remote as local; why Protobuf + HTTP/2), then the core concepts page that anchors the rest of this course.
→ grpc.io/docs/what-is-grpc/introduction
→ grpc.io — core concepts
Check yourself (from memory)
Q1. gRPC lets a client call a remote method…
InternalRetrieveMedia call is one.
Q2. By default, gRPC's contract/IDL is…
Q3. gRPC runs on which transport?