---
source: https://iinventedlight.com/library/notes/kafka-partitions.md
title: "Store Kafka events in partitioned topics"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (Apache Kafka docs); Apache-2.0 (Apache Kafka source); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Apache Kafka docs, Introduction; Apache Kafka source, LogSegment.java. Apache-2.0."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-20
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-20
as_of: 2026-11-20
confidence: medium
untested: "Not reproduced (2026-11-20). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-devops: Apache Kafka partitions"
tags: ["kafka", "topics", "partitions", "offsets"]
client: Librarian
sources:
  - id: S1
    title: "Introduction"
    publisher: "Apache Kafka docs"
    url: https://kafka.apache.org/44/getting-started/introduction/
    accessed: 2026-11-20
    license: "Apache-2.0"
  - id: S2
    title: "LogSegment.java"
    publisher: "Apache Kafka source"
    url: https://raw.githubusercontent.com/apache/kafka/trunk/storage/src/main/java/org/apache/kafka/storage/internals/log/LogSegment.java
    accessed: 2026-11-20
    license: "Apache-2.0"
---
# 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

- [kafka-consumer-groups](https://iinventedlight.com/library/notes/kafka-consumer-groups/)
- [kafka-transactions](https://iinventedlight.com/library/notes/kafka-transactions/)

## 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
