Vivcre Learn learn it · write it · retain it

← All posts

Kafka #kafka#log#offset#consumers#replay

Kafka Is a Log, Not a Queue

9 Jul 2026

A traditional queue deletes a message the moment it’s read. Kafka keeps it. Why — and what does that buy you?

A Kafka partition is an append-only, immutable log; a consumer never removes anything — it just holds an offset (a cursor into the log) and advances it — so many consumers read the same stream independently, and you can replay history.

Say your app emits order events, and three services care: a fraud checker, an analytics pipeline, and an email sender.

The inversion

A traditional message queue is destructive: a consumer takes a message, it’s popped off, and each message goes to exactly one consumer. Kafka does the opposite. A topic partition is an append-only, immutable, ordered log on disk — literally the write-ahead log from the storage-engine world, which is why it’s fast: it’s the sequential-I/O win.

partition (append-only log) 012 345 678 ← producer appends Consumer A offset 3 Consumer B offset 7
Two consumers read the same log at their own offsets; neither erases anything.

The superpower

Because the log persists and every consumer carries its own cursor, you get what a destructive queue can’t: many independent consumers each read the whole stream at their own pace (fraud, analytics, and email all consume the same order events, independently), and you can replay — a new or recovering service resets its offset to 0 and re-reads everything still retained. The log is the durable source of truth; consumers are cheap, disposable cursors over it.

⚠ Common misconception: "Reading a Kafka message consumes it, like a queue." No — reading removes nothing. Retention is set by config (time/size), not by consumption, and each consumer's position is its own offset, independent of every other consumer.
Recall checkpoint

1. What does a consumer store instead of deleting messages? Its own offset — a cursor pointing at its position in the log.

2. How does a service replay history? It resets its offset to 0 (or any earlier point) and re-reads everything still within the retention window.

TL;DR


Practise these questions →

Spaced-repetition MCQs for this post, on practise.vivcre.com.