Question 12 of 50
What is a Kafka Cluster?
Question
"What is a Kafka Cluster, and why is it made up of multiple brokers?"
What the interviewer wants to assess
Whether you understand cluster as Kafka's real unit of availability and scale, not just as "several servers together" without understanding the coordination between them.
Resposta rápida
A Cluster is the set of brokers that together store and serve every topic in a Kafka installation. The brokers coordinate with each other — today via KRaft — to elect a controller, distribute partitions, and detect failures, all transparently to producers and consumers.
Resposta nível Sênior
A cluster exists so Kafka doesn't depend on a single machine: each topic's partitions are spread across the cluster's brokers, and each one is replicated (Chapter 5) to tolerate losing one or more brokers, depending on the configured replication factor. Coordination between brokers — who the cluster controller is, which broker is leader for each partition, which brokers are alive — is done via KRaft (Kafka Raft), which replaced ZooKeeper in current versions, eliminating an external dependency Kafka historically needed for cluster metadata.
Exemplo financeiro
A production cluster for a digital bank might have 6 brokers spread across 3 different availability zones (2 per zone), guaranteeing that losing an entire zone doesn't bring down the cluster, as long as the replication factor and replica distribution are configured with that topology in mind.
"A Kafka cluster needs ZooKeeper"
That was true in older versions, but current Kafka versions use KRaft, a self-contained consensus protocol (based on Raft) for cluster metadata coordination, eliminating the ZooKeeper dependency. Mentioning this migration shows up-to-date knowledge of the platform.
Pode vir a seguir
Likely follow-ups: "what is Replication Factor?" and "what happens when a broker in the cluster goes down?".
Related chapters