The two nice-to-haves (pub/sub + point-to-point patterns, dead letter queues)
A cluster of brokers sits between producers and consumers; messages land in partitioned, repliecated logs; and a coordination service keeps the whole cluster's metadata consistent.
The Components:
What makes it distributed? Partitioning + replication. Each topic is split into partitions and each partition is replicated across brokers (fault tolerance).
The primary store is an append-only commit log, not a traditional DB:
A separate small store (ZooKeeper or an internal KRaft quorum) holds the state about the cluster:
Important distinction to make: message data lives in the log; metadata lives in the coordination store. Interviewers love hearing that separation.
Sketch these as an ER-ish set:
Topics(id, name, partitions, replication_factor, retention_ms) Partitions(id, topic_id, partition_index, leader_broker_id, replicas) Brokers(id, host, port, status, last_heartbeat) ConsumerGroups(id, name) Offsets(group_id, topic_id, partition_id, offset) Messages(topic_id, partition_id, offset, key, value, timestamp, headers)
Note the relationship that matters: a partition belongs to a topic, and offsets belong to (group, topic, partition) — that composite key is what lets consumers resume exactly where they crashed.
When a producer sends a message:
acks=all, the leader only acknowledges after all ISR followers confirm — this is your "no message loss on broker failure" requirement made real. Replication factor 3 is the standard.Notice the pattern: every major point is a Requirement made concrete — replication = fault tolerance, acks = delivery guarantees, ISR + sequence numbers = exactly-once, rebalancing = availability.