Kafka architecture, explained from the original paper
Kafka is best understood as a distributed, partitioned, append-only log. Producers write events, brokers store them, and consumers pull at their own pace using offsets.
Interactive model
Producers append to partition logs
Events are batched and written sequentially. Kafka leans into append-only disk access instead of random queue mutation.
offset
0
offset
215
offset
430
offset
645
offset
0
offset
188
offset
376
offset
564
offset
0
offset
204
offset
408
offset
612
own offset, same topic
own offset, same topic
01
The core model: topics split into partitions
A Kafka topic is a named event stream, such as pageviews or clicks. Kafka splits each topic into partitions so data can be spread across brokers and consumed in parallel.
This is the main scaling lever. More partitions allow more brokers to store data and more consumers to process data. Kafka preserves order within a partition, not across the entire topic.
02
Each partition is an append-only log
Producers append messages to the end of a partition. Each message is addressed by an offset, which is just its logical position in the log.
offset 0
message A
offset 215
message B
offset 430
message C
offset 645
message D
This design avoids heavy per-message indexes. It also makes replay natural: a consumer can move its offset backward and read the same data again.
03
Consumers pull data in groups
Kafka does not push messages to consumers. Consumers ask brokers for records from a specific offset and fetch batches of data.
Consumer group: real-time metrics
Consumer group: warehouse loader
Within a group, a partition is owned by one consumer at a time. That keeps ordering simple and avoids locking between consumers. Different groups can read the same stream independently.
04
Why the broker is intentionally simple
Kafka brokers store bytes and serve fetch requests. They do not track every consumer's delivery state. In the original design, consumer offsets and partition ownership were coordinated through ZooKeeper.
Page cache
Kafka relies on the operating system page cache instead of duplicating data in broker memory.
sendfile
Brokers can move bytes from disk to socket with fewer copies.
Retention
Messages are kept for a time window, so consumers can replay old data.
05
Deployment pattern from the paper
LinkedIn ran Kafka clusters in live datacenters for real-time consumers, then copied streams to an analysis datacenter near Hadoop and the data warehouse.
The result was one pipeline for online and offline consumers, with about 10 seconds of end-to-end latency in their production setup.
Takeaway
The design choice behind the architecture
Kafka became fast because it narrowed the problem. It traded heavyweight queue semantics for append-only logs, batched I/O, pull-based reads, consumer-managed offsets, and partition-level parallelism.
The architecture is not just a broker cluster. It is a storage model: durable streams with independent bookmarks for every consumer group.