AceReady
Kafka
Question 1 of 13
Easy

What is the difference between a topic and a partition in Kafka ?

Answer

A topic is the named logical stream that producers publish messages to, the equivalent of a category or a channel. A topic is physically split into one or more partitions, each an ordered, immutable log that messages are appended to sequentially. This split into partitions is what lets Kafka parallelize load, by spreading partitions across multiple brokers and letting several consumers process different partitions in parallel.

Common trap

The trap is believing Kafka guarantees a global message order across the whole topic: ordering is only guaranteed within a single partition, not across different partitions, which has direct consequences on the choice of partitioning key.