DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk3 min

Kafka Topics: Partitions and Offsets, Clearly Defined

Kafka topics name record feeds, partitions hold ordered logs, and offsets identify positions within individual partitions. Learn how that shapes ordering and consumer-group progress.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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
Sale
Franz Kafka: The Complete Stories
  • Used Book in Good Condition

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.Support on Ko-Fi

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.