A Kafka topic is a named stream of records, partitions are the ordered logs that store them, and an offset marks a record’s position within one partition. Kafka preserves order within each partition—not across every partition in a topic—and a consumer reading a record does not delete it.
How topics, partitions, and offsets fit together
Think of a topic as a subject with several separate numbered notebooks. The topic names the feed; each notebook represents a partition; and the numbers in a notebook are offsets. This is only an analogy: separate notebooks do not create a shared numbering system or a single combined order.
As an Amazon Associate I earn from qualifying purchases.
- Topic: a named category or feed to which producers publish records.
- Partition: an ordered log within a topic. Kafka appends records to a partition.
- Offset: a position in one partition’s log. It is not a topic-wide record ID.
The same numeric offset can appear in different partitions. For example, offset 12 in partition 0 and offset 12 in partition 1 identify positions in separate logs, not the same record. See Apache Kafka’s introduction to Kafka for the foundational model.
What ordering Kafka guarantees
Kafka guarantees order within a partition. Its documentation puts the limit plainly: “Kafka only provides a total order over records within a partition, not between different partitions in a topic.” Records in different partitions therefore cannot be compared by offset alone to determine which came first.
#1 Best Overall
If an application needs one total order for all records in a topic, using a single partition is the straightforward option. The trade-off is that a consumer group cannot divide that topic’s partition-level work among multiple consumers. For requirements that permit independent ordered streams, multiple partitions allow more parallel work.
How partitions affect consumer groups
A consumer group is a set of consumer instances that share work. Kafka assigns the topic’s partitions among members of a group. A given partition is assigned to one consumer in that group at a time, so adding consumers beyond the number of available partitions does not create more partition-level work slots for that topic.
Rank #2
For example, imagine an orders topic with two partitions. A group with two consumers can have one partition assigned to each. Each consumer reads its assigned partition in order. Kafka does not establish whether the record at offset 12 in partition 0 came before or after the record at offset 8 in partition 1.
A different consumer group can read the same topic independently, with its own progress position. The group model and ordering behavior are described in the Kafka documentation on ordering and consumer groups.
Rank #3
Why reading a record does not delete it
Reading advances a consumer’s position; it does not remove the record from the topic. Retention settings determine how long records remain available. If a record is still retained, a consumer can move its position back and read it again. This is why Kafka’s log and a consumer’s progress are separate things.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Record offsets versus committed consumer offsets
A record’s offset identifies its position in a partition. A consumer group’s committed offset is stored progress for that group and partition. It is not the record itself, nor does it automatically prove that an application completed processing a particular record: that depends on when and how the application commits progress.
Kafka’s operations tooling can show group positions, log-end positions, and lag, and supports resetting offsets. For example, the Kafka 3.8 operations guide documents the command pattern kafka-consumer-groups.sh --describe --group ... for inspecting a group. Consult the Kafka 3.8 operations documentation for exact flags and reset procedures, and use the command reference for the Kafka version you run.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallOutdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchQuick Recap
Best Value
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




