Inferensys

Glossary

Offset

A unique, sequential identifier assigned to each record within a partition of a distributed log, used by consumers to track their reading position.
Strategy consultant facilitating AI use case discovery workshop, sticky notes on glass wall, casual corporate meeting.
STREAM PROCESSING FUNDAMENTALS

What is Offset?

An offset is a unique, monotonically increasing sequence number assigned to each record within a specific partition of a distributed log, serving as the immutable pointer that consumers use to track their precise reading position.

In systems like Apache Kafka, an offset is not a global identifier but a partition-scoped, sequential integer. When a producer writes a record, the broker appends it to the end of a partition log and assigns the next incremental offset. This offset acts as an immutable, deterministic index, allowing consumers to resume processing from a specific point after a failure or restart by committing their last-read offset to a durable store.

Offset management is the core mechanism for achieving at-least-once or exactly-once semantics. A consumer group coordinates offset commits to avoid reprocessing or data loss. If a consumer crashes and restarts, it fetches the last committed offset, not the log's end, enabling precise replay. This contrasts with traditional message queues that destroy messages upon acknowledgment; the offset model decouples consumption from data retention, allowing historical reprocessing.

POSITION TRACKING IN DISTRIBUTED LOGS

Core Characteristics of Offsets

An offset is a unique, monotonically increasing sequence number assigned to each record within a partition. It serves as the fundamental cursor for consumers to track their reading position, enabling independent, parallel, and replayable consumption.

01

Immutable Position Marker

Once assigned, an offset is never changed. It is a permanent, sequential identifier for a record's position within a specific partition. This immutability is the foundation of the log's durability and auditability.

  • Offsets are only meaningful within the context of a single partition.
  • They are assigned by the broker upon message append.
  • A consumer's current offset represents the next record it will read.
02

Consumer Offset Management

Consumers track their progress by committing their current offset back to the system. This decouples consumption state from the broker, allowing consumers to restart and resume exactly where they left off.

  • Automatic Commits: The consumer periodically commits the latest offset in the background.
  • Manual Commits: The application explicitly controls when an offset is committed, typically after processing is complete.
  • Committed offsets are stored in an internal __consumer_offsets topic in systems like Apache Kafka.
OFFSET MANAGEMENT

Frequently Asked Questions

Clear, technical answers to the most common questions about the role of the offset in distributed streaming systems and how it enables reliable, high-throughput data consumption.

An offset is a unique, sequential, and immutable identifier assigned to each record within a specific partition of a distributed log. It serves as the record's exact positional address, allowing consumers to track their reading progress. When a producer writes a message to a partition, the broker assigns it the next incremental integer offset, starting from 0. This sequential ID is the fundamental mechanism that enables strict ordering guarantees within a partition and allows consumer groups to independently commit their read position, facilitating parallel, fault-tolerant consumption of unbounded data streams.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.