What are topics, partitions and offsets in Kafka, and how long does Kafka keep messages?
Short answer
A topic is a named stream of events split into partitions; each partition is an ordered append-only log, and the offset is a record's position in that partition. Kafka doesn't delete on read: it keeps data by retention or compaction.
3 points to say:
- A partition is an append-only log: the unit of parallelism and the unit of ordering; an offset only means something within one partition.
- Reading doesn't delete: consumers track their own offsets, so many groups read independently and can replay.
- Data goes away by retention (time/size) or compaction (latest value per key); segments make deleting old data cheap.
Keep reading the deep dive
Create a free account to read the full explanation and follow-up questions, mark questions as studied and review them on a schedule.