A Kafka broker can write a batch of order events and serve it to several consumers without reading the batch back from the storage device for each request. It can also send stored record bytes without first copying the entire payload into a broker application buffer.
The operating system's page cache and Kafka's zero-copy fetch path make these savings possible. We'll follow a batch through the write and read paths, then examine what changes when data leaves the cache, a connection uses TLS, or the broker runs short of memory.
Our examples use a KRaft-based cluster on Linux with ordinary buffered local filesystem I/O and tiered storage disabled. We use modern record batches and distinguish the standard unencrypted transport from Kafka's standard Java TLS transport. The exact transfer mechanism depends on the Kafka version, JDK, operating system, and transport implementation.