003. Kafka Theory. Topic Replication - MarkHuntDev/my-kafka-exercises GitHub Wiki
Topic replication factor
- Topics should have a replication factor > 1 (usually between 2 and 3)
- Replication factor equal to 3 is the gold standard
- This way if a broker is down, another broker can serve the data
- Example: Topic-A with 2 partitions and replication factor of 2
- Example: we lost Broker 102
- Result: Broker 101 and 103 can still serve the data
Concept of a Leader for a Partition
- At any time only ONE broker can be a leader for a given partition
- Only that leader can receive and serve data for a partition
- The other brokers will synchronize the data
- Therefore each partition has one leader and multiple ISR (in-sync replica)