0
0
Kafkadevops~3 mins

Why In-sync replicas (ISR) in Kafka? - Purpose & Use Cases

Choose your learning style9 modes available
The Big Idea

What if your data vanished the moment your main server failed? ISR stops that nightmare.

The Scenario

Imagine you run a busy online store where orders come in every second. You keep a list of orders on one computer. If that computer crashes, you lose all recent orders and your customers get upset.

The Problem

Relying on just one computer means if it fails, data is lost. Manually copying data to other computers takes time and can miss updates. This causes delays and errors, making your store unreliable.

The Solution

In-sync replicas (ISR) automatically keep copies of data on multiple computers updated at the same time. If one fails, another ready copy takes over instantly, so no orders are lost and your store stays open.

Before vs After
Before
producer.send(data)
# no guarantee data is copied to other servers immediately
After
producer.send(data).get()
# data is confirmed on all in-sync replicas before continuing
What It Enables

It enables reliable, fault-tolerant systems that never lose data even if some servers fail.

Real Life Example

When you post a message on social media, ISR ensures your post is saved on multiple servers instantly, so it won't disappear if one server crashes.

Key Takeaways

Manual data copying is slow and risky.

ISR keeps multiple copies updated together automatically.

This protects data and keeps systems running smoothly.