Skip to content

CONCEPT Cited by 1 source

Producer acks and durability (Kafka)

Definition

In Apache Kafka, producers choose per-session how strong a durability guarantee they want per write via the acks property:

Value Semantics Durability
acks=0 Producer does not wait for a response None — fire-and-forget; record may be lost before it reaches the broker
acks=1 Response when the leader acknowledges (persists to disk) Durable on the leader; lost if leader dies before follower replication
acks=all (default) Response only when all in-sync replicas persist Durable on every ISR member; survives leader failure

Kozlovski's Kafka-101 framing:

"Producers can configure the durability guarantees they want to have during writes via the 'acks' property which denotes how many brokers have to acknowledge a write before the response is returned to the client." (Source: sources/2024-05-09-highscalability-kafka-101)

Composing with min.insync.replicas

acks=all depends on the ISR. If the ISR shrinks to one member (only the leader is in-sync), acks=all silently collapses to the acks=1 guarantee — same wire-level behaviour, weaker guarantee.

min.insync.replicas fixes this by failing the write closed if the ISR drops below the configured threshold:

"To further control the acks=all property and ensure it doesn't regress to an acks=1 property when there is only one in-sync replica, the min.insync.replicas setting exists to denote the minimum number of in-sync replicas required to acknowledge a write that's configured with acks=all." (Source: sources/2024-05-09-highscalability-kafka-101)

This is the canonical Kafka-durability instance of fail-closed semantics — prefer returning an error over silently weakening the contract.

Trade-offs

  • Latency scales with durability: acks=0 < acks=1 < acks=all.
  • Availability conversely: acks=all requires the whole ISR; acks=1 only the leader.
  • acks=all + min.insync.replicas=2 on replication.factor=3 is the canonical "safe default" — can tolerate one replica loss without losing writes and without silent degradation.

Seen in

Last updated · 319 distilled / 1,201 read