Overview
A topic is a named category of events that producers write to and consumers read from. Topics are split into partitions: each partition is an ordered log that events are appended to, and events with the same key are written to the same partition. Each record in a partition has an offset, a single integer giving its position. Kafka guarantees that a consumer of a topic-partition reads that partition's events in exactly the order they were written; the guarantee is stated per partition.
Analogy
Key configuration
num.partitions (broker, default 1) — default partition count for newly created topics
retention.ms (topic, default 604800000 = 7 days) — how long events are kept
retention.bytes (topic, default -1 = no limit) — size cap, enforced per partitionProduction tip
Check yourself
Message A is written to partition 0 and message B to partition 1 of the same topic. What does Kafka guarantee about their order?
Sources
- Introduction (4.2 documentation) (opens in a new tab)
- Design (4.2 documentation) (opens in a new tab)
- Topic configs (4.2 documentation) (opens in a new tab)
- Basic Kafka operations (4.2 documentation) (opens in a new tab)
Checked against Kafka 4.2 documentation on Oct 2026. Draft: not yet reviewed by a Kafka specialist. Releases move on, so confirm against the current documentation before you act on a number.