Oh My Algorithm
Concept GuideLeader/Follower · ISR

Replication & ISR

Each partition has one leader and several followers, and the leader alone handles reads and writes. Followers copy the leader's log, and the set of replicas that have kept up is called the ISR. When the leader dies a new one is elected from the ISR, so being in the ISR is exactly what makes a replica safe to promote.

01Replication & ISR

One partition is replicated across three brokers. Only one of them is the leader; the rest are followers.

Reads and writes all go to the leader. Followers never talk to clients directly.

Followers continuously pull the leader's log and append it to their own. That's replication.

The list of replicas that have kept up is called the ISR. Right now all three are in it.

Broker 3 has slowed down and stalled at offset 2. The leader is at 5, so it has fallen well behind.

Fall behind for long enough and it drops out of the ISR. Now only brokers 1 and 2 are in it.

A smaller ISR means fewer failures you can absorb. That's why an ISR-shrink alert matters.

Now broker 1, the leader, dies. A new leader has to be chosen.

The new leader is only ever chosen from the ISR. Lagging broker 3 isn't eligible, so broker 2 is promoted.

Broker 2 already held everything through offset 5, so it takes over without losing data.

ClientBroker 1Leader0 · 1 · 2Broker 2Follower0 · 1 · 2Broker 3Follower0 · 1 · 2
1 / 10

In short

the ISR is the list of replicas safe to promote right now. It's also exactly what acks=all waits for.

02 Understand It Simply

For Everyone
🔑How It Works

A partition is replicated across brokers, and only the leader serves reads and writes. The replicas that have kept up form the ISR, and a new leader is elected only from it, so stored data is not lost.

💡In Plain Words

Writes always go to the leader.

Followers keep pulling the leader's log and appending it to their own, and the ones that haven't fallen behind stay in the ISR.

Leader elections draw only from the ISR, so a shrinking ISR means fewer failures you can absorb.

acks=all is the setting that waits on that same ISR — replication and durability are two sides of one design.

📍Where It's Used
  • Setting replication factor and min.insync.replicas
  • calculating how many broker failures you can survive
  • and reading ISR-shrink alerts correctly

03 Frequently Asked Questions

FAQ
What is Replication & ISR?+

Each partition has one leader and several followers, and the leader alone handles reads and writes. Followers copy the leader's log, and the set of replicas that have kept up is called the ISR. When the leader dies a new one is elected from the ISR, so being in the ISR is exactly what makes a replica safe to promote.

Where is Replication & ISR used?+

Setting replication factor and min.insync.replicas, calculating how many broker failures you can survive, and reading ISR-shrink alerts correctly.

What's a simple analogy for Replication & ISR?+

A partition is replicated across brokers, and only the leader serves reads and writes. The replicas that have kept up form the ISR, and a new leader is elected only from it, so stored data is not lost.