PRIMITIVE #19Core Distributed Systems Component
API Protocols — HTTP/1.1 vs. HTTP/2 vs. HTTP/3 (QUIC) vs. gRPC
1. What It Is & Why It Exists
The Core Problem: Network Inefficiency & Head-of-Line Blocking
In modern distributed systems and web architectures, network transport efficiency directly dictates user perceived latency, server thread utilization, and bandwidth costs:
- HTTP/1.1 Inefficiencies: Textual wire format with verbose, uncompressed headers. Concurrency requires opening multiple TCP connections (browsers open up to 6 per origin). Suffers from Application-Layer Head-of-Line (HOL) Blocking—a slow request blocks all subsequent requests on that TCP connection.
- HTTP/2 Breakthroughs & Transport HOL: Introduced binary framing, stream multiplexing over a single TCP connection, and HPACK header compression. However, because it runs on single-stream TCP, a single lost packet blocks all multiplexed streams until TCP retransmits and reorders the packet (Transport-Layer HOL Blocking).
- HTTP/3 & QUIC (UDP): Eliminates Transport HOL blocking by running over UDP. Each multiplexed stream is independent. Combines the transport handshake and TLS 1.3 cryptographic handshake into a single roundtrip ( or connection resumption) and provides native Connection Migration across network switches (e.g., Wi-Fi to 5G cellular).
- gRPC & Protocol Buffers: High-performance, strongly-typed Remote Procedure Call (RPC) framework built on HTTP/2 or HTTP/3 transport using Protobuf binary serialization, bi-directional streaming, and client/server code generation.
Interactive Architecture DiagramSynthesizing vector architecture diagram...
2. Core Mechanics & Wire Protocol Comparison
Interactive Architecture DiagramSynthesizing vector architecture diagram...
Comprehensive Protocol Comparison Matrix
| Feature | HTTP/1.1 | HTTP/2 | HTTP/3 (QUIC) | gRPC (over H2/H3) | WebSocket |
|---|---|---|---|---|---|
| Underlying Transport | TCP | TCP | UDP (QUIC) | TCP / UDP | TCP |
| Wire Format | Text / ASCII | Binary Frames | Binary Frames | Protocol Buffers (Binary) | Binary / Text Frames |
| Multiplexing | No (Pipelining flawed) | Yes (Single TCP) | Yes (Independent UDP) | Yes (Multiplexed RPCs) | Full Duplex Stream |
| HOL Blocking | Application Layer | Transport (TCP) Layer | None | None (on H3) / TCP (on H2) | None (single stream) |
| Header Compression | None | HPACK (Static/Dynamic table) | QPACK (Out-of-order) | HPACK / QPACK | Minimal (2-14 byte frame) |
| Handshake Latency | (TCP + TLS) | (TCP + TLS 1.3) | (QUIC + TLS 1.3) | (Fast reuse) | (HTTP Upgrade) |
| Connection Migration | No (Breaks on IP change) | No (Breaks on IP change) | Yes (64-bit Connection ID) | No (Depends on transport) | No |
| Streaming Support | Chunked Transfer | Server Push / Streams | Independent Streams | Unary, Client, Server, Bi-di | Full Duplex Bi-directional |
| Primary Use Case | Legacy Web / Simple APIs | Modern Web Ingress | Mobile Browsing, Video, CDN | Internal Microservices RPC | Real-time Chat, Live Feeds |
Part 2: Production Deep-Dive Locked1 Coin = 24 Hours
Unlock Complete Architecture & Production Runbooks
Your Balance:40 Coins
You have explored the free architectural preview (~48%). Spend 1 Coin to unlock the remaining 5 production deep-dive sections for a full 24 hours.
Sections Included in This 24-Hour Pass:
3. Mathematical & Network Performance Formulations
4. Production gRPC Service Architecture
5. Critical Edge Cases & Distributed Failure Modes
6. AWS Reference Architecture
7. Interview Delivery Framework
Keeps page unlocked for exactly 24 hoursSpend coins to fund LLM & compute infrastructure