Try
↑ ↓ move↵ openesc close

Interview prep / Partitioned logs

Junior · Partitioned logs · System design interview question

What is a partition in a log-based system, and why have more than one?

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

A strong answer

A partition is one ordered, append-only slice of a topic. Each message gets an offset in its partition. Several partitions let many consumers read in parallel and let producers write to several machines.

One partition is one line with one reader, so its throughput is limited to what a single consumer can handle. With more partitions the topic scales out.

Order holds inside a partition, not across partitions. The partition count also sets how many consumers in a group can work at once.

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