2.1. Synchronous Communication Protocols
Synchronous protocols block the caller until a response returns, which makes them simple to reason about and dangerous under load: every downstream slowdown propagates directly back to the user. This chapter dissects the dominant request-response protocols from the wire up — REST’s HTTP contract, HTTP/2 and HTTP/3 multiplexing, gRPC over persistent connections, GraphQL’s query model — and the cross-cutting concerns they all share: deadline propagation, versioning, and what a failed call actually means.
Topics Covered
Section titled “Topics Covered”- 2.1.1. REST: Constraints, Resources, and HTTP Contracts: Covers REST’s architectural constraints, resource modeling, and the HTTP contract that underpins most web APIs.
- 2.1.2. HTTP/2 and HTTP/3: Multiplexing, HOL Blocking, and QUIC: Traces head-of-line blocking from HTTP/1.1 through HTTP/2 multiplexing to HTTP/3’s QUIC transport over UDP.
- 2.1.3. gRPC & Protocol Buffers: High-Performance RPC: Explains high-performance RPC over HTTP/2 with Protocol Buffers, deadline propagation, and status-code semantics.
- 2.1.4. gRPC Streaming: Unary, Server-Streaming, Bi-directional: Covers the four gRPC call types, from unary to bidirectional streaming, and their flow-control mechanics.
- 2.1.5. GraphQL: Query Language and Federation Architecture: Details GraphQL’s query model, the N+1 problem and DataLoader, and federation for composing a graph across services.
- 2.1.6. WebSocket and Server-Sent Events: Real-Time Communication: Compares WebSocket’s full-duplex channel with Server-Sent Events for pushing real-time data to clients.
- 2.1.7. API Versioning Strategies: Surveys strategies for evolving an API without breaking existing clients: URI, header, and content negotiation.