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.replicassetting exists to denote the minimum number of in-sync replicas required to acknowledge a write that's configured withacks=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=allrequires the whole ISR;acks=1only the leader. acks=all+min.insync.replicas=2onreplication.factor=3is the canonical "safe default" — can tolerate one replica loss without losing writes and without silent degradation.
Seen in¶
- sources/2024-05-09-highscalability-kafka-101 — canonical wiki
statement of the three-level
acksdial +min.insync.replicasas the fail-closed composer.
Related¶
- systems/kafka
- concepts/in-sync-replica-set —
acks=allsemantics are evaluated against the ISR. - concepts/leader-follower-replication — the replication shape
acksis layered over. - concepts/fail-open-vs-fail-closed — general posture choice;
min.insync.replicasis a fail-closed lever.