Store Kafka events in partitioned topics
Answer: Apache Kafka is an event streaming platform. Events are organized and durably stored in topics. Topics are partitioned across brokers, and replication is performed at the level of topic-partitions.
Topics and partitions
Apache Kafka is an event streaming platform. Some of these servers form the storage layer, called the brokers. Conceptually, an event has a key, value, timestamp, and optional metadata headers. Events are organized and durably stored in topics. Topics in Kafka are always multi-producer and multi-subscriber.
A topic is partitioned, meaning it is spread over a number of buckets located on different Kafka brokers. Events that share an event key are written to the same partition. A consumer of a given topic-partition always sees that partition's events in the write order. Both producers may write to the same partition if appropriate.
| topic | partition | |---|---| | events stored durably | buckets on different brokers | | key, value, timestamp | same event key, same partition | | OffsetIndex | logical offsets to file positions |
Replication and segments
To make data fault-tolerant, every topic can be replicated. A common production setting is a replication factor of 3. This replication is performed at the level of topic-partitions. Each segment has two components: a log and an index. The index is an OffsetIndex that maps from logical offsets to physical file positions.
See also
Claims
- id: C1 claim: Events are organized and durably stored in topics. source: S1 evidence: "Events are organized and durably stored in topics ."
- id: C2 claim: Replication is performed at the level of topic-partitions. source: S1 evidence: "This replication is performed at the level of topic-partitions."
- id: C3 claim: Each log segment has a log and an index that maps logical offsets to file positions. source: S2 evidence: "Each segment has two components: a log and an index."
Sources
- [S1] Introduction. Apache Kafka docs. https://kafka.apache.org/44/getting-started/introduction/ . License: Apache-2.0. Accessed 2026-11-20.
- [S2] LogSegment.java. Apache Kafka source. https://raw.githubusercontent.com/apache/kafka/trunk/storage/src/main/java/org/apache/kafka/storage/internals/log/LogSegment.java . License: Apache-2.0. Accessed 2026-11-20.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Apache Kafka docs, Introduction; Apache Kafka source, LogSegment.java. Apache-2.0. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Apache Kafka docs, Introduction; Apache Kafka source, LogSegment.java. Apache-2.0.
Cite this
iinventedlight. 2026. "Store Kafka events in partitioned topics." iinventedlight Library, iil:note:k99133ck, version of 2026-11-20. https://iinventedlight.com/library/notes/kafka-partitions/. License: CC-BY-4.0.
@misc{iil_note_k99133ck,
author = {{iinventedlight}},
title = {{Store Kafka events in partitioned topics}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-20},
url = {https://iinventedlight.com/library/notes/kafka-partitions/},
note = {Permanent ID iil:note:k99133ck. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- kafka-partitions.table.json (table; CC-BY-4.0)
- kafka-partitions.schema.json (schema; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/kafka-partitions.md.