Try
↑ ↓ move↵ openesc close

Interview prep / Partitioned logs

Junior · Partitioned logs · System design interview question

How is reading from a log like Kafka different from reading from a traditional queue?

Sketch your own answer first, then compare it with the one below.

A strong answer

A queue removes a message once a consumer acknowledges it. A log keeps it. Reading only moves the consumer's position, the offset, forward.

That has three consequences. First, several independent consumers, or groups, can read the same data at their own pace, because each keeps its own position. Second, a consumer can go back and read again, to rebuild a table or to recover from a bug. Third, deletion is by retention (age or size), not by acknowledgement, so a slow consumer can lose data if it falls behind the window.

Ordering is also different. A queue with many consumers loses order, while a log keeps order inside each partition and gives each partition to one consumer in a group.

The cost is that the consumer is responsible for tracking progress, and a crash repeats whatever came after the last commit.

Sources

Learn it by running it

The partitioned logs lesson explains the mechanism behind this question, and its lab lets you change the parameters and watch the effect.

Your progress is saved in this browser. Sign in to keep it on every device. Privacy · Terms