Integration / Apache Kafka Interview questions
Define replication in Kafka?
Replication means each partition's data is copied to multiple brokers, not just stored on one, so the cluster can survive a broker failure without losing data or availability. The number of copies is set per topic via the replication factor — a replication factor of 3 means every partition has one leader replica and two follower replicas, each living on a different broker.
kafka-topics.sh --create --topic orders --partitions 3 --replication-factor 3 --bootstrap-server localhost:9092
Followers continuously fetch new records from their partition's leader to stay caught up; a follower that's fully caught up is considered part of the in-sync replica (ISR) set. If the broker hosting the leader fails, Kafka can promote one of the in-sync followers to be the new leader, so the partition keeps serving reads and writes with no data loss, as long as at least one in-sync replica survived the failure.
More Related questions...