Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing
Back
  1. Home
  2. Interview prep
  3. What is a Kafka broker?

Kafka · Core Concepts

What is a Kafka broker?

Easykafka-05
brokerclusterreplicationbasics

Question

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

Solution

A broker is one Kafka server process. It:

  • Stores topic partition 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.

        ┌────────── Kafka cluster ──────────┐        │  broker-1   broker-2   broker-3   │        │   P0-L       P0-F       P1-L      │        │   P1-F       P2-L       P2-F      │        └───────────────────────────────────┘  L = leader replica, F = follower replica   

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."

PreviousNext