Which network choices change behavior
Which network mechanisms change what your system means, and which only change how fast and how cheaply bytes move?
A frame, and an honest sort
The articles on transport, flow control and routing were about semantic decisions: choices that change what your system means. A queue and a log give different answers to "can I replay?" A partition key decides which order exists. A dead-letter queue trades completeness for availability.
Most of this article is different. Zero-copy, connection pooling, keep-alive and TLS termination are mainly constant-factor optimizations and operational hygiene. They change how fast and how cheaply records move. They do not change what the movement means. For these you should know that they exist, know the one or two failure modes of each, and look up the details when you need them.
Two items are exceptions and deserve real attention:
- Protocol framing decides where a malformed record fails: at write time, in the producer, or at read time, in the consumer. That decides who has to debug it.
- Compression interacts with batching, partitioning and CPU budgets in ways that regularly surprise people.
So these two get depth, and the rest get what they are worth.
One idea organizes everything below. Each mechanism answers one of three questions:
| Question | Mechanisms |
|---|---|
| How do I avoid paying a fixed cost again and again? | connection pooling, keep-alive, zero-copy, coalescing (Nagle) |
| How does the receiver know where a message starts and ends? | framing |
| What am I willing to spend to move fewer bytes, or safer bytes? | compression, TLS |
(A fixed cost is a cost paid once per operation whatever its size, such as the setup of a connection. Paying it once and sharing it between many records is the idea behind batching, which Flow control explained.)