# Kafka Replication Factor

> Kafka keeps more than one copy of each partition. This number says how many.

**Field:** Data Engineering  
**Category:** Ingestion & Streaming  
**Also known as:** Replication Factor, Topic Replication Factor

## Think of it like

It is like giving three friends a copy of your house key. Lose one, and you still get in.

## Definition

The replication factor is how many copies of each partition Kafka keeps. Each copy sits on a different broker. One copy is the leader and takes the writes. The others follow it. If the leader's broker dies, a follower takes over. A factor of 3 is a common setting in real use, while a factor of 1 means one dead machine can lose data.

## Example

Emma's topic has a replication factor of 3 across three brokers. One broker fails in the night, and no event is lost.

## Example code

```console
$ bin/kafka-topics.sh --create --topic orders --partitions 3 \
    --replication-factor 3 --bootstrap-server localhost:9092
```

Three partitions, and each one is kept on three brokers.

## Why it matters

Machines fail. Copies on other brokers are what keep a failure from losing events.

## Common mistake

Leaving it at 1 for real data. One broken disk then means lost events.

## Three principles

- **Copies.** Each partition, several times.
- **Leader and followers.** One takes writes, the rest follow.
- **Three is common.** Survives losing a broker.

## Related terms

- [Kafka Broker](https://learn.benibix.com/term/data/kafka-broker)
- [Kafka Partition](https://learn.benibix.com/term/data/kafka-partition)
- [Apache Kafka](https://learn.benibix.com/term/data/apache-kafka)
- [Kafka Retention](https://learn.benibix.com/term/data/kafka-retention)
- [Database Replication](https://learn.benibix.com/term/development/database-replication)

![Top: one partition as seven boxes, day 1 to day 7. Day 1 is greyed out and deleted, even if nobody read it; the newest day is highlighted. Bottom: three brokers holding the same partition. Broker 1, highlighted, is the leader and takes the writes; brokers 2 and 3 hold copies that follow it.](https://learn.benibix.com/diagrams/dat2-kafka-storage.svg)

---

Source: https://learn.benibix.com/term/data/kafka-replication-factor
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
