Message Broker Vocabulary
5 exercises — master message broker vocabulary: Kafka topics and partitions, consumer groups vs fan-out, dead-letter queues, delivery semantics (at-least-once, exactly-once), and the log retention model.
0 / 5 completed
Message broker vocabulary quick reference
- Topic — named logical channel for a category of events (e.g.
order-placed) - Partition — physical ordered log subdivision of a topic; enables parallel consumption
- Consumer group — set of consumers sharing load-balanced partition assignment
- Fan-out — multiple consumer groups each receive ALL events from a topic
- Dead-letter queue (DLQ) — destination for messages that failed after N retries
- At-least-once — no loss, but possible duplicates; requires idempotent consumers
- Log retention — Kafka retains events on disk for configurable time; consumers read at their own pace
1 / 5
In Apache Kafka, what is the architectural difference between a topic and a partition?
Topics and partitions are a two-level hierarchy in Kafka's architecture.
Topic:
• A logical category / channel that groups related events
• You produce to a topic and consume from a topic
• Like a "table" in a database — defines the schema/purpose of the events
• Example:
Partition:
• A physical ordered sequence (log file on disk) that is a subdivision of a topic
• Enables parallelism — multiple consumers can read from the same topic simultaneously (each reads its own partition subset)
• Ordering guarantee is only within a partition, not across partitions
• Events with the same partition key (e.g.,
Example:
• Partition 0: orders from users A-G (determined by key hash)
• Partition 1: orders from users H-N
• Partition 2: orders from users O-Z
• 3 consumer instances can read in parallel
Key vocabulary:
• Topic — logical named channel for a category of events
• Partition — physical, ordered, immutable log segment within a topic
• Partition key — determines which partition an event goes to (ensures ordering per entity)
• Offset — the position of an event within a partition (sequential integer)
Topic:
• A logical category / channel that groups related events
• You produce to a topic and consume from a topic
• Like a "table" in a database — defines the schema/purpose of the events
• Example:
order-placed, payment-processed, user-registeredPartition:
• A physical ordered sequence (log file on disk) that is a subdivision of a topic
• Enables parallelism — multiple consumers can read from the same topic simultaneously (each reads its own partition subset)
• Ordering guarantee is only within a partition, not across partitions
• Events with the same partition key (e.g.,
userId) always go to the same partition — ensuring order for a given entityExample:
order-events topic with 3 partitions:• Partition 0: orders from users A-G (determined by key hash)
• Partition 1: orders from users H-N
• Partition 2: orders from users O-Z
• 3 consumer instances can read in parallel
Key vocabulary:
• Topic — logical named channel for a category of events
• Partition — physical, ordered, immutable log segment within a topic
• Partition key — determines which partition an event goes to (ensures ordering per entity)
• Offset — the position of an event within a partition (sequential integer)