Protocol Buffers
The language your API is written in
Section titled “The language your API is written in”Everything in gRPC starts from a .proto file, and that file is written in Protocol Buffers. Before you can design services and RPC methods, you need fluency in the building block they carry: the message.
This module is about protobuf the schema language — how to model your data precisely, and how to shape it so it can grow for years without breaking the clients you already shipped.
What this module covers
Section titled “What this module covers”| Lesson | What you’ll learn |
|---|---|
| Messages & Fields | Message syntax and why every field carries a number, not just a name |
| Scalar Types & Defaults | The built-in types, proto3 default values, and the optional presence trap |
| Enums, Nested & oneof | Enumerations (with the zero-value rule), nesting, and mutually-exclusive fields |
| Repeated, Maps & Well-Known | Lists, key/value maps, and the standard library of google.protobuf types |
| Evolving Schemas | The rules that let a schema change safely — and the ones that break clients |
Why the schema deserves its own module
Section titled “Why the schema deserves its own module”A protobuf message is deceptively simple — a few typed fields with numbers. But those numbers, defaults, and evolution rules are exactly where real systems get into trouble:
flowchart TB msg["message design (fields + numbers)"] --> types["type & default choices"] types --> evolve["schema evolution (add / reserve / never reuse)"] evolve --> safe["clients keep working across versions"]
Get the field numbers and evolution rules right early, and your API can add features for years without a breaking change. Get them wrong, and you’re stuck with a versioning headache the first time a message needs to grow.