Question 11 of 50
What is a Broker?
Question
"What is a Broker in Kafka?"
What the interviewer wants to assess
Whether you understand the broker as the real infrastructure unit behind the topic/partition abstraction — not just as a vague synonym for "Kafka server."
Resposta rápida
A Broker is a running Kafka process. It physically stores the data for one or more partitions and responds to producer (write) and consumer (read) requests for those partitions. A Kafka cluster is made up of multiple brokers working together.
Resposta nível Sênior
A broker is Kafka's storage and serving unit: a process that keeps on disk the log files for a subset of the partitions across every topic in the cluster. For each partition it hosts, a broker acts as leader (serving all of its reads and writes) or as follower (passively replicating the leader's data, Chapter 5). A cluster spreads partitions across its brokers to parallelize load and tolerate losing any one of them, as long as the configured replication factor allows it.
Exemplo financeiro
A cluster of 3 brokers hosting the pagamentos.aprovados topic (12 partitions, replication factor 3)
spreads those partitions and their replicas across the 3 brokers in a balanced way — no single broker
concentrates all of the topic's write traffic.
"Broker is just a fancy name for server"
Broker specifically refers to the Kafka process, not the physical or virtual machine hosting it. It's common (but not required) to run one broker per machine in production, but the distinction between "broker process" and "machine" matters when discussing scale and replica distribution.
Pode vir a seguir
Likely follow-ups: "what is a Kafka Cluster?" and "what happens when a broker goes down?".
Related chapters