Is it possible to lose data in Kafka despite having replication set up? If so, how?

Yes — replication reduces the risk of data loss in Kafka but doesn't eliminate it, since the producer's acknowledgment setting determines how many replicas must confirm a write before it's considered safe.

Key Points

Example

A team running acks=1 might see recently produced records disappear if the leader broker crashes moments after acknowledging the write but before followers finish replicating it — switching to acks=all with min.insync.replicas=2 closes that gap.

# Risky: data can be lost even with replication factor 3
acks=1                                 # leader confirms before followers copy
min.insync.replicas=1
unclean.leader.election.enable=true    # stale replica may become leader
enable.auto.commit=true                # offset committed before processing

# Safe: survives a broker failure without losing acknowledged writes
acks=all
enable.idempotence=true
min.insync.replicas=2                  # with replication factor 3
unclean.leader.election.enable=false
enable.auto.commit=false               # commit after processing

Interview Tip

A concise interview answer is

Yes, data loss is still possible with replication if acks=1 is used and the leader fails before followers catch up, or if unclean leader election is enabled — the fix is acks=all combined with an appropriate min.insync.replicas and disabling unclean leader election for critical topics.

Last updated: 1 November 2026

Previous question: Why does a consumer group sometimes take a long time to rebalance when a new consumer joins or leaves, and how would you reduce this time?

Next question: When would you prefer using a compacted topic over a regular topic, and what are the trade-offs?

More Kafka (Optional) interview questions

All Kafka (Optional) questions