Loading MQ::STREAM...
“Instead of deleting messages upon read, systems like Apache Kafka and Redpanda store events in an immutable, append-only commit log on disk. Topics are split into multiple partitions for horizontal scaling.”
Why Kafka partitions use sequential disk writes, OS PageCache, and Zero-Copy for millions of ops/sec.
// Producing with Key-Based Partitioning
const producer = kafka.producer();
await producer.send({
topic: 'customer-transactions',
messages: [
{
key: 'user_4821', // All events for user_4821 route to the SAME partition
value: JSON.stringify({ action: 'TRANSFER', amount: 500 }),
timestamp: Date.now()
}
]
});Sequential disk I/O approaches raw physical drive write speeds (hundreds of MB/s), outperforming random memory access in traditional database engines.