← All notes

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

Sources

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

Permanent ID: iil:note:k99133ck

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.},
}

Markdown

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.

All artifact files (JSON index)

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.