Replication, ISR & Acks

Durability is a contract between producer acks and replica state.

0/4 done

acks + min.insync.replicas

Replication and the ISR

Each partition has one leader and N-1 followers. Followers continuously fetch from the leader. A follower that is caught up (within replica.lag.time.max.ms) is in the In-Sync Replica (ISR) set.

Producer durability is governed by acks:

  • acks=0 — fire-and-forget. May lose data on broker crash.
  • acks=1 — wait for leader only. Loses data if leader dies before replication.
  • acks=all (with min.insync.replicas≥2) — wait for every ISR. Survives RF-1 failures.

Do not use acks=1 for data you can't afford to lose. The performance win is small; the data-loss surface is huge.

Author a durable producer config

Author a client.properties file you'd hand to ops for the payments topic. It must enable idempotence, set acks=all, cap retries explicitly, and turn on Snappy compression.

Reading in progress · 0 of 4 activities done