- rtshkmr's digital garden/
- References/
- Architecture Design Basics/
- Pattern Taxonomy/
- Encoding & Data Formats/
- Transport Protocols/
Transport Protocols
··
203 words·
1 min
Table of Contents
π P1 — understanding HTTP/2 is essential for gRPC; WebSocket vs SSE comes up in real-time designs
Problem #
The transport layer determines connection multiplexing, head-of-line blocking, and real-time communication capability.
HTTP Versions #
| Feature | HTTP/1.1 | HTTP/2 | HTTP/3 (QUIC) |
|---|---|---|---|
| Multiplexing | β One request per conn | β Many streams per conn | β Many streams per conn |
| Head-of-line blocking | TCP-level | TCP-level (still!) | β Per-stream (UDP-based) |
| Header compression | β No | β HPACK | β QPACK |
| Server push | β No | β Yes | β Yes |
| Connection setup | TCP + TLS (2-3 RTT) | TCP + TLS (2-3 RTT) | 0-1 RTT (QUIC handshake) |
Real-time Push Mechanisms #
| Mechanism | Direction | Protocol | Use case | Complexity |
|---|---|---|---|---|
| Long-polling | Server β Client | HTTP/1.1 | Legacy real-time | Low |
| Server-Sent Events | Server β Client | HTTP/1.1+ | Notifications, feeds | Low |
| WebSocket | Bi-directional | WS | Chat, gaming, collaboration | Medium |
| gRPC streaming | Bi-directional | HTTP/2 | Internal service streaming | Medium |
Instinct #
HTTP/2 is the default for service-to-service. HTTP/3 is still emerging for backend use. For real-time client features: SSE if you only need serverβclient push (simpler, works with HTTP/2, auto-reconnect). WebSocket if you need true bi-directional (chat, collaborative editing). Avoid long-polling in new designs.
DDIA 2e Reference #
- Chapter 4: Modes of dataflow
- Chapter 11: Stream processing (for server-push patterns)
Other references #
- digital ocean:http1.1 vs 2