gRPC ยท Protocol Buffers ยท HTTP/2 ยท Quarkus ยท Python

API Patterns and Practices: gRPC

Designing gRPC APIs well, with runnable examples in Quarkus and Python against one Protobuf contract.

๐Ÿ“One Protobuf contract, enforced by Buf, as the single source of truth
๐Ÿ”—Every example in both Quarkus and Python
โœ…CI asserts response semantics against the proto โ€” a wrong field fails the build
๐Ÿ“ŠTraced end to end through the Grafana LGTM stack

What this site is

A chapter-based, hands-on path to designing gRPC APIs well, built around a single Protocol Buffers contract โ€” linted and breaking-change-gated by Buf โ€” for a shipping and cargo domain. gRPC here is the internal, latency-sensitive routing and tracking service that the sibling REST booking service calls. Every hands-on chapter ships the same example in both Quarkus and Python, generated from that one proto, and CI asserts each response against it โ€” an OK that carries a contract-violating message fails the build. You work through the four RPC types, deadlines and the rich error model, schema evolution, backend concurrency, streaming and backpressure, performance tuning, security, observability, the Kubernetes load-balancing problem, gRPC-Web and transcoding. It assumes you can read Java and Python; it is not a tutorial in either language. The code tabs are built to admit Go and C++ later. All container images are UBI-based, and the stack runs on Docker Compose, minikube, and OpenShift Local.

Part 0

Prerequisites & the Lab

Get the contract-first (proto + Buf) toolchain running locally: Quarkus, Python, Docker Compose + LGTM, and the shipping/cargo domain.

2 chapters Explore โ†’
Part 1

Why gRPC, and the Decision Lens

Decide whether gRPC fits an interaction and classify any call on five axes.

2 chapters Explore โ†’
Part 2

Protocol Buffers: the Contract Language

Model the shipping domain in protobuf and make it the Buf-enforced single source of truth both stacks generate from.

3 chapters Explore โ†’
Part 3

HTTP/2 & the Four RPC Types

Explain why gRPC is fast and implement and choose among all four RPC shapes.

4 chapters Explore โ†’
Part 4

Reliability: Deadlines, Errors & Interceptors

Make calls fail correctly and bound their own blast radius.

3 chapters Explore โ†’
Part 5

Schema Evolution & the Living Contract

Design and evolve a proto without breaking clients, enforced by CI.

2 chapters Explore โ†’
Part 6

Concurrency & Long-Running Work

Serve I/O-bound RPCs without exhausting threads and model work that outlives one call.

2 chapters Explore โ†’
Part 7

Streaming at Scale & Performance

Run streaming safely under load and tune and benchmark the service.

2 chapters Explore โ†’
Part 8

Security

Encrypt, mutually authenticate, and authorize gRPC calls.

2 chapters Explore โ†’
Part 9

Observability, Mesh & Load Balancing

Trace an RPC across the REST to gRPC seam and run gRPC correctly behind Kubernetes.

2 chapters Explore โ†’
Part 10

Browsers, Transcoding & Cross-Protocol

Expose gRPC to a browser or REST client and choose gRPC vs alternatives, including over HTTP/3.

2 chapters Explore โ†’
Part 11

Testing & Debugging

Prove conformance and debug a gRPC service end to end.

2 chapters Explore โ†’
Part 12

Running It & the Final Project

Run, observe, and defend a complete gRPC system across all three tiers.

2 chapters Explore โ†’