📥Kafka Replication Factor
Also known as Replication Factor, Topic Replication Factor
Kafka keeps more than one copy of each partition. This number says how many.
Think of it like
It is like giving three friends a copy of your house key. Lose one, and you still get in.
Example
Emma's topic has a replication factor of 3 across three brokers. One broker fails in the night, and no event is lost.
Why it matters
Machines fail. Copies on other brokers are what keep a failure from losing events.
Definition
Example code
console
$ bin/kafka-topics.sh --create --topic orders --partitions 3 \
--replication-factor 3 --bootstrap-server localhost:9092Common mistake
Key takeaways
- 1Copies. Each partition, several times.
- 2Leader and followers. One takes writes, the rest follow.
- 3Three is common. Survives losing a broker.