Kafka · Producers & Consumers

Producer acks: 0, 1, and all

Mediumacksdurabilityproducerisrmin.insync.replicas

Interview question

Explain Kafka producer `acks=0`, `acks=1`, and `acks=all`. Trade-offs?

How to answer

The short answer

acks controls how many replicas must confirm a write before the producer considers it successful.

acks=0 (fire and forget)

  • Producer does not wait for a broker response.
  • Highest throughput, lowest durability.
  • Messages can be lost silently (network blip, broker crash).
  • Rarely acceptable for business data.

acks=1 (leader only)

  • Leader writes to its local log and responds.
  • Followers may not have the data yet.
  • If leader crashes before followers catch up, data can be lost.
  • Common compromise for less critical streams.

acks=all (or acks=-1)

  • Leader waits until the record is replicated to the full ISR (all in-sync replicas).
  • Strongest durability among the three.
  • Pair with min.insync.replicas (e.g. 2) so "all" still means a real quorum of copies.

Trade-off table

acksLatencyDurabilityTypical use
0LowestWeakestmetrics / best-effort
1MediumMediumless critical logs
allHighestStrongestorders, payments,

Interview tip: Prefer acks=all + min.insync.replicas=2 + RF=3 for important data. Say why, not just the setting name.