Skip to main content

Apache Kafka

At a glance
  • Problem solved: collect huge volumes of events (logs, clicks, metrics) and deliver them within seconds to many consumers, while retaining them so they can be read again.
  • Era: built at LinkedIn in 2010, open sourced in January 2011, Apache Incubator on July 4, 2011, top-level project on October 23, 2012. Kafka 4.0, without ZooKeeper, in March 2025.
  • Created by: Jay Kreps, Neha Narkhede and Jun Rao (LinkedIn), who founded Confluent in November 2014.
  • Category: distributed log, event streaming platform.

Historical context​

In the late 2000s, consumer web sites produce unprecedented amounts of logs: the founding Kafka paper (NetDB 2011) cites almost 6 TB of user activity events per day at Facebook and 5 to 8 TB of call records per day at China Mobile. To gather them, there are log aggregators (Scribe at Facebook, Data Highway at Yahoo, Flume at Cloudera), designed to fill a Hadoop warehouse in batch, and message queues (ActiveMQ, RabbitMQ, JMS) that offer rich guarantees but are costly. Jun Rao sums it up in 2011: JMS "adds significant overhead in the message representation".

At LinkedIn the need is twofold: feed offline analytics, but also real-time applications "with delays of no more than a few seconds". Jay Kreps recounts in his essay "The Log" (2013) that he took this on around 2008, while trying to get Hadoop running to move recommendation jobs there. He then decides to combine what message queues do with the log concept that is everywhere in databases and distributed systems. Kafka goes into service in 2010 as LinkedIn's central data pipeline.

The code is open sourced on January 11, 2011, enters the Apache Incubator on July 4, 2011 and becomes a top-level project on October 23, 2012. The June 2011 paper already reports close to a billion messages per day. Later versions fill the gaps accepted at the start: replication in 0.8.0, log compaction in 0.8.1, exactly-once in 0.11 (2017).

In November 2014, Kreps, Narkhede and Rao leave LinkedIn to found Confluent, raising $6.9M from Benchmark, Data Collective and LinkedIn. Kafka becomes the backbone of streaming: in 2019 LinkedIn handles more than 7 trillion messages per day, and the official site claims more than 80% of Fortune 100 companies. In March 2025, Kafka 4.0 removes ZooKeeper, replaced by an internal Raft quorum (KRaft).

Key idea​

Kafka is not a queue you remove messages from: it is an append-only log, "an append-only, totally-ordered sequence of records ordered by time" in Kreps's words. Producers append at the end, consumers read at their own pace and remember their position (offset), and messages stay stored for a retention period (typically 7 days in 2011), whether or not they were read. Several applications can therefore read the same stream, and an application can replay the history. Kreps draws an architecture from it: "Take all the organization's data and put it into a central log for real-time subscription."

How it works​

  • Topic and partitions: a topic is split into partitions; each partition is a physical log made of segment files (about 1 GB in 2011). The partition is "the smallest unit of parallelism".
  • Offset: a message has no id of its own, it is "addressed by its logical offset in the log". A consumer can go back to an old offset to read again.
  • Pull model: each consumer fetches messages "at the maximum rate it can sustain", without being flooded.
  • Consumer groups: the partitions of a topic are spread across the members of a group; each group reads the whole stream independently of the others.
  • System efficiency: no application cache, Kafka relies on the OS page cache, and the sendfile call sends file bytes to the network while avoiding "2 of the copies and 1 system call".
  • Replication and compaction: since 0.8.0 each partition is replicated on several brokers; compaction keeps the latest value per key to rebuild a state.
  • Metadata: ZooKeeper used to coordinate the cluster; KIP-500 moved the metadata "in Kafka itself", into a log managed by a Raft quorum (KRaft), the only mode available in 4.0.
topic "pageviews", partition 0

offset 0 1 2 3 4 5 6
[m0] [m1] [m2] [m3] [m4] [m5] [m6] (producers append on the right)
| |
group "analytics" reads offset 2 group "search" reads offset 6

By the numbers​

FigureContextSource
50,000 and 400,000 msg/sProducer throughput with batches of 1 and 50 messages, against ActiveMQ and RabbitMQ (2011)NetDB 2011 paper
9 bytes vs 144Per-message overhead, Kafka vs ActiveMQ (2011)NetDB 2011 paper
Close to 1 billionMessages per day at LinkedIn (2011)NetDB 2011 paper
60 billionUnique message writes per day at LinkedIn, 75 TB stored per datacenter (2013)"The Log" essay
800 billion, 1,100 brokersMessages per day (175 TB), on more than 60 clusters (March 2015)LinkedIn Engineering 2015
7 trillionMessages per day, more than 4,000 brokers and 7 million partitions (2019)LinkedIn Engineering 2019
$6.9MConfluent's first funding (November 2014)Confluent announcement
More than 80%Share of Fortune 100 companies using Kafka (2026)kafka.apache.org

Milestones​

  • 2010: Kafka becomes LinkedIn's central data pipeline.
  • January 11, 2011: open sourced by LinkedIn.
  • June 2011: paper "Kafka: a Distributed Messaging System for Log Processing" at NetDB.
  • July 4, 2011: enters the Apache Incubator.
  • October 23, 2012: Apache top-level project.
  • Kafka 0.8.0: partition replication; log compaction in 0.8.1.
  • December 2013: Jay Kreps's essay "The Log".
  • November 2014: Kreps, Narkhede and Rao found Confluent.
  • June 2017: exactly-once with release 0.11 (idempotence and transactions).
  • March 18, 2025: Kafka 4.0, the first major release "entirely without Apache ZooKeeper".

Did you know?​

  • A writer's name. Jay Kreps explains: "since Kafka was a system optimized for writing using a writer's name would make sense. I had taken a lot of lit classes in college and liked Franz Kafka."
  • Fewer guarantees, on purpose. In 2011 Kafka only offers at-least-once: "losing a few pageview events occasionally is certainly not the end of the world". Exactly-once only arrives in 2017.
  • A Kafkaesque wink. The Confluent announcement has a section titled "Making data integration less Kafkaesque".
  • Copied by AWS. In 2013 Kreps notes that Amazon offers Kinesis, "very very similar to Kafka", and sees it as the sign of a good abstraction.

Strengths and limitations​

StrengthsLimitations
Very high throughput thanks to the sequential log, the page cache and sendfileNot an analytical compute engine: it transports and stores, others compute
Decouples producers and consumers, each reading at its own paceRunning ZooKeeper next to Kafka meant "two separate distributed systems" (KIP-500)
Replay of history thanks to offsets and retentionExactly-once came late (0.11, 2017) and must be enabled explicitly
Proven scale: 7 trillion messages per day at LinkedIn (2019)Ordering is only guaranteed within a partition

What came next​

  • Stream processing on top of Kafka: Storm (with a KafkaSpout at Twitter), Flink, Spark Structured Streaming, or Samza, cited in LinkedIn's VLDB 2015 paper.
  • Kreps's critique of the Lambda architecture (Kappa, 2014), which makes the replayable log the single source: see the timeline.
  • Pulsar, born at Yahoo, separates serving and storage where Kafka keeps both in the broker.
  • Trino exposes Kafka topics as tables through its Kafka connector.

Sources​

To do
  • Exact release dates of 0.8.0 (replication), 0.8.1 (compaction) and 3.3 (KRaft deemed production ready): to read in the official release notes.
  • Kafka Connect and Kafka Streams (ecosystem mentioned in the previous version of the page): versions and dates to source.
  • "Ordering is only guaranteed within a partition": backed by the exactly-once post ("in-order delivery per partition"), to confirm in the current documentation.
  • Quote about the name: read through a search snippet of the Quora page, to check on the page itself.