Apache Kafka Streaming (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)
What are Topics, Partitions, and Offsets in Kafka?
junior LevelApache KafkaMicroservices
In Simple Words:
- Topic: A logical category or stream name to which records are published (e.g.,
orders,user-signups). Similar to a table in a database. - Partition: A topic is divided into one or more partitions. Partitions are the fundamental unit of parallelism and physical storage in Kafka. Each partition is an ordered, immutable sequence of records.
- Offset: A unique, sequential integer assigned to each record within a partition (e.g., 0, 1, 2, ...).
- Offsets are local to a specific partition (Partition 0 has Offset 5; Partition 1 also has Offset 5).
- Offsets guarantee strict message ordering only within a single partition, never across different partitions.