How does Kafka achieve fault tolerance?

Kafka achieves fault tolerance by replicating every partition across multiple brokers, so the failure of any single broker doesn't cause data loss or an unavailable topic.

Key Points

Example

If a topic has replication factor 3 and the broker hosting the current leader crashes, Kafka promotes one of the two remaining in-sync replicas to leader within seconds, and producers/consumers reconnect to the new leader with no data loss.

# Broker / topic side
default.replication.factor=3          # every partition copied to 3 brokers
min.insync.replicas=2                 # a write needs at least 2 copies
unclean.leader.election.enable=false  # never elect an out-of-date replica

# Producer side
acks=all                              # wait for all in-sync replicas
enable.idempotence=true               # retries don't create duplicates
retries=2147483647
delivery.timeout.ms=120000

# Consumer side
enable.auto.commit=false              # commit only after processing

Interview Tip

A concise interview answer is

Kafka achieves fault tolerance by replicating each partition across multiple brokers and automatically electing a new leader from the in-sync replicas if the current leader fails, so as long as replication factor and min.insync.replicas are configured sensibly, a single broker failure doesn't cause downtime or data loss.

Last updated: 11 November 2026

Previous question: How can consumer groups enhance the scalability of Kafka?

Next question: What is the role of replication in Kafka?

More Kafka (Optional) interview questions

All Kafka (Optional) questions