Describe the concept of a Kafka Broker and its role in the ecosystem.

Instruction: Provide an overview of what a Kafka Broker is, its main functions, and its significance within a Kafka cluster.

Context: This question aims to assess the candidate's understanding of Kafka architecture, specifically the role and responsibilities of brokers in managing and distributing data.

Updated

Official answer

A Kafka broker is a server process that stores partition replicas and serves client and replication requests. A cluster spreads replicas across brokers so that storage and work can be distributed.

For a partition it leads, a broker accepts producer writes and coordinates replication progress. Followers fetch the log from the leader. Consumers normally fetch from leaders, although configured follower fetching is supported. Brokers also enforce configured retention, quotas, authentication and authorization, and host group or transaction coordination responsibilities.

In Kafka 4.x, KRaft controllers manage cluster metadata, broker registration and partition leadership. A process can have a broker role, a controller role, or both; these are distinct responsibilities. Production deployments commonly separate controller and broker roles. ZooKeeper is not the Kafka 4.x metadata mechanism.

A new broker does not automatically redistribute all existing partition replicas. Plan placement or reassignment, then monitor replication traffic, disk and leadership balance. A replication factor states how many copies are assigned; it does not prove that every copy is currently caught up.

Brokers support durability and availability under configured failure assumptions. They cannot promise uninterrupted operation or zero loss under every failure. Check acknowledgement policy, eligible replicas, fault-domain placement, available storage and the controller quorum, and test recovery.

KRaft roles, replica placement and reassignment

Related Questions