Distributed services live or die by their communication contracts. An inefficient serialization format wastes gigabytes of network bandwidth and thousands of CPU cycles parsing strings. A careless schema modification can instantly crash downstream consumers in production.

This module deconstructs modern service communication and contract engineering:

  • Wire Protocols: HTTP/1.1 vs. HTTP/2 and HTTP/3 multiplexing, binary framing, header compression (HPACK/QPACK), and connection pooling.
  • Protocol Buffers & Schema Evolution: How tag-based encoding achieves dense binary payloads and enables backward and forward compatibility without distributed lockstep deployments.
  • API Ergonomics & Pagination: Why naive OFFSET pagination causes database scans and phantom duplicates, and how keyset/cursor pagination guarantees deterministic seek performance.
  • Resilience Semantics: Idempotency keys, distributed deadline propagation, and cancellation trees that terminate unneeded downstream RPCs when user requests are cancelled.

What you will learn

  • Compare wire efficiency, serialization throughput, and CPU overhead across JSON over HTTP/1.1 vs. Protocol Buffers over HTTP/2 (gRPC)
  • Enforce strict schema evolution rules: field tag preservation, unknown field handling, and zero-downtime deprecation workflows
  • Analyze cursor-based seek pagination vs. SQL LIMIT/OFFSET pagination to eliminate O(N) disk page scans and unstable result sets
  • Implement distributed deadline propagation and context cancellation across multi-tier microservice trees to stop zombie RPC executions
STAGE TOPICS

Topics in this chapter