Skip to content
Kafka Is Fun

BeginnerCore Concepts

What is an offset in Kafka?

Reference answer

An offset is a 64-bit integer that identifies a record's position within one partition; the log doc calls it the message ID in that partition. Offsets are assigned per partition, so the same offset number appears in every partition of a topic, and a record is located by topic, partition and offset. A new partition starts at offset 0 and offsets grow as records are appended. An offset never changes once assigned, even when compaction removes earlier records, so gaps can appear. A consumer's position in each partition is a single integer: the offset of the next record it will consume. Committing an offset saves that position; the committed offset is the next record to process (last processed offset plus one), not the last one processed.

Expected key concepts: offset, 64-bit integer, position, per partition, never changes, position, next record, commit, last processed offset plus one

How did that feel?

Your own verdict, not the score. It shows up next to this question in the list, so you can come back to the shaky ones.