|
| 1 | +# HTTP Alternatives for APIs |
| 2 | + |
| 3 | +Most API code is written without a protocol decision. Engineers reach for REST over HTTP because it is what they know, what the framework assumes, and what everyone else uses. That is a reasonable default — but it is still a choice, and like any invisible choice, it has costs. |
| 4 | + |
| 5 | +This book surveys the alternatives: what they are, how they work, where they outperform REST, and where they do not. It is organized as a practical tour rather than a reference manual. Each chapter covers one protocol or family of protocols in enough depth to understand the tradeoffs, with the goal of making protocol selection a deliberate decision rather than an accidental one. |
| 6 | + |
| 7 | +## What This Book Covers |
| 8 | + |
| 9 | +**Chapter 1 — The Default We Never Questioned** |
| 10 | +Why REST became the baseline, what it costs in performance and expressiveness, and when those costs matter enough to look elsewhere. |
| 11 | + |
| 12 | +**Chapter 2 — gRPC** |
| 13 | +Protocol Buffers and HTTP/2 under the hood: strongly-typed contracts, efficient binary serialization, and streaming primitives that REST cannot express. |
| 14 | + |
| 15 | +**Chapter 3 — WebSockets and SSE** |
| 16 | +Full-duplex connections and server-sent events: when you need the server to push data rather than wait to be asked. |
| 17 | + |
| 18 | +**Chapter 4 — MQTT and the IoT World** |
| 19 | +Publish-subscribe over constrained networks: designed for unreliable connections, minimal overhead, and millions of devices. |
| 20 | + |
| 21 | +**Chapter 5 — AMQP and Message Brokers** |
| 22 | +Enterprise messaging with guaranteed delivery, routing, and backpressure — the RabbitMQ ecosystem and when you need a broker in the middle. |
| 23 | + |
| 24 | +**Chapter 6 — ZeroMQ** |
| 25 | +Messaging without a broker: low-latency socket patterns for high-throughput systems that cannot afford the overhead of a central queue. |
| 26 | + |
| 27 | +**Chapter 7 — Cap'n Proto RPC and the Binary Frontier** |
| 28 | +Zero-copy serialization and capability-based RPC at the extreme end of the performance spectrum. |
| 29 | + |
| 30 | +**Chapter 8 — Lesser-Known Contenders** |
| 31 | +Thrift, Avro, Flatbuffers, Nano, NATS, and others that solve real problems in specific contexts. |
| 32 | + |
| 33 | +**Chapter 9 — What Nobody Has Tried Yet** |
| 34 | +Emerging directions: QUIC, WebTransport, local-first architectures, and patterns at the edge of current practice. |
| 35 | + |
| 36 | +**Chapter 10 — How to Choose** |
| 37 | +A decision framework for matching protocol to use case, with worked examples across common API scenarios. |
0 commit comments