Explain the process and challenges of scaling out a Kafka cluster.

Instruction: Describe both the technical and operational considerations when scaling a Kafka cluster.

Context: This question is designed to assess the candidate's understanding of the complexities involved in scaling Kafka clusters, including data balancing, broker configuration, and cluster stability.

Updated

Official answer

First identify the saturated resource: disk space/throughput, CPU, network, partition leadership or downstream processing. Adding brokers helps only if the workload can use their capacity.

Provision compatible brokers with unique node identities, correct cluster metadata setup, listeners, advertised addresses, security and storage. Do not format an existing broker's data as if it were a new node. Add capacity with enough free space to survive both normal failures and the temporary replication work.

Existing replicas do not automatically become evenly distributed just because a broker joins. Plan partition reassignment using replica bytes, leader load and failure-domain placement. Move bounded batches, throttle movement when needed and monitor replication catch-up, disk pressure, request latency and under-replicated partitions. Verify completion and clean up temporary reassignment throttles through the supported tools.

Changing replication factor or partition count is a separate decision, not a prerequisite for adding brokers. Replication adds network/storage cost; partition growth can change keyed routing and ordering assumptions. Balance leaders as well as replica storage, and confirm the intended placement after movement.

Set pause/rollback criteria before starting. Validate capacity and recovery under a broker failure, not merely healthy steady state. Success means the target throughput, latency, headroom and recovery objectives are met without data or access-policy changes; daily active users are not a direct measure of a successful rebalance.

Adding capacity and partition reassignment, KRaft operations

Related Questions