HTTP/2 & Protocol Buffers: The gRPC Foundation
Understand the two technologies that make gRPC fast: HTTP/2 transport and Protocol Buffers binary serialization.
HTTP/2 & Protocol Buffers: The gRPC Foundation is a free gRPC & High Performance APIs lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the gRPC & High Performance APIs learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
What Powers gRPC
gRPC's speed comes from two pieces: HTTP/2 for transport and Protocol Buffers for serialization. Together they explain why it beats JSON-over-HTTP/1.1.
HTTP/1.1 Limits
HTTP/1.1 sends one request per connection at a time; pipelining is fragile and head-of-line blocking forces many connections. That's latency and overhead for chatty APIs.
HTTP/2 Multiplexing
HTTP/2 multiplexing sends many concurrent streams over one connection. Requests stop blocking each other, and it's what enables gRPC's bidirectional streaming.
Binary Framing & Header Compression
HTTP/2 frames data in binary and compresses headers with HPACK. Fewer bytes on the wire plus cheaper parsing means lower latency than text-based HTTP/1.1.
What Are Protocol Buffers?
Protocol Buffers is a compact, schema-driven binary format. You define messages once in a .proto file and tooling generates code in many languages.
message User {
int32 id = 1;
string name = 2;
bool active = 3;
}Field Numbers Matter
On the wire each protobuf field carries a tag number, not its name — that's what keeps payloads tiny. Never reuse or change a tag, or you break compatibility.
Why Protobuf Is Small & Fast
Protobuf stays small and fast by dropping field names from the payload, using varint encoding for integers, and skipping JSON's whitespace and quotes.
Schema-First Contracts
The .proto file is a strong contract shared by client and server. Both generate type-safe code from it, killing a whole class of loosely-typed JSON bugs.
Putting It Together in gRPC
A gRPC call maps cleanly: the method is an HTTP/2 stream, request and response messages are protobuf bytes, and streaming uses multiple frames on that stream.
service UserService {
rpc GetUser (UserRequest) returns (User);
}Trade-offs
The trade-offs: binary payloads aren't human-readable, browsers need a grpc-web proxy, and you need codegen tooling. For internal high-throughput services, usually worth it.
Why It Beats JSON/REST
Summed up: gRPC wins because HTTP/2 multiplexes efficiently and protobuf serializes compactly, while a shared schema keeps both ends type-safe.
Quick Check
Test your understanding of gRPC's foundation.
Recap
gRPC's two foundations: HTTP/2 brings multiplexed streams and binary framing, while Protocol Buffers give a compact, schema-first format. Together: faster and type-safe.
Frequently asked questions
Is the “HTTP/2 & Protocol Buffers: The gRPC Foundation” lesson free?
Yes — the full text of “HTTP/2 & Protocol Buffers: The gRPC Foundation” is free to read here on the web, and the gRPC & High Performance APIs course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the gRPC & High Performance APIs course, upgrade to CoddyKit PRO.
What will I learn in “HTTP/2 & Protocol Buffers: The gRPC Foundation”?
Understand the two technologies that make gRPC fast: HTTP/2 transport and Protocol Buffers binary serialization. You practise gRPC & High Performance APIs with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start gRPC & High Performance APIs?
No prior experience is required. gRPC & High Performance APIs on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “HTTP/2 & Protocol Buffers: The gRPC Foundation” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this gRPC & High Performance APIs lesson?
Yes. Every gRPC & High Performance APIs lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Why High Performance APIs?
- What is gRPC?
- RPC vs. REST Overview
- HTTP/2 & Protocol Buffers: The gRPC Foundation