Kafka depends on Operating system Page Cache. Page cache is like files/data written to Disk, its index/meta cached on Ram by Operating system. Kafka takes the advantage of this. Kafka internal code gets the message from producer, then it writes to memory (page cache) and then it writes to disk.