Kafka · Core Concepts

What is a Kafka broker?

Easybrokerclusterreplicationbasics

Interview question

What is a Kafka broker, and what does a cluster of brokers do?

How to answer

The short answer

A broker is one Kafka server process. It:

  • Stores topic logs on disk (segment files)
  • Serves produce and fetch requests from clients
  • Holds replicas of partitions for durability
  • Participates in cluster membership and leadership

Cluster

Several brokers form a Kafka cluster. Partitions and replicas are spread across brokers so load and failure risk are shared.

Bootstrap servers

Clients are given a few broker addresses (bootstrap.servers). From those, the client discovers the full cluster metadata (which broker leads which partition).

Failure behavior

If a broker dies:

  • Partitions that had their leader on that broker elect a new leader from remaining in-sync replicas.
  • Producers/consumers refresh metadata and continue (with some downtime for those partitions).

Laptop vs production

One broker is fine for local learning. Production uses multiple brokers (and replication factor > 1) so a single machine failure does not lose data or kill the cluster.

Interview tip: "Broker = Kafka server. Cluster = brokers sharing topics and replicas."