Oh My Algorithm
Concept Guideacks=0/1/all · Durability

Producer & acks

A producer chooses how far a message must be stored before it counts as a success. acks=0 waits for nothing and is fastest but never learns whether a broker received it; acks=1 counts the leader's write as success, so a leader failure can lose it; acks=all needs the replicas to have stored it too — the safest and the slowest.

01Producer & acks

acks=0 · no confirmation

acks=0 sends the message and moves straight on. It never waits for a response.

Whether the broker received it, whether it hit disk — the producer has no idea. There is no arrow coming back.

If the network drops and the message vanishes, nothing surfaces on the producer side. There isn't even grounds to retry.

Produceracks=0Broker 1LeaderBroker 2FollowerBroker 3M
1 / 3

In short

the fastest and the riskiest. Reserve it for metrics and logs where a little loss is acceptable.

acks=1 · leader only

acks=1 waits for the leader broker to confirm that it wrote the message to its own log.

Once the leader responds, the producer counts it as a success and moves to the next message. The acknowledgement comes straight back from the leader.

The catch is that the followers may not have replicated it yet. Replication trails behind.

If the leader dies at this moment, one of the followers becomes the new leader — and that message exists nowhere.

Produceracks=1Broker 1LeaderBroker 2FollowerBroker 3M
1 / 4

In short

enough for most cases, but a leader failure at the wrong moment loses data. The middle ground.

acks=all · replicas too

acks=all counts a write as successful only once the caught-up replicas (the ISR) have stored it too.

The leader writes, and the followers pull that message across. Nothing proceeds until this finishes.

Only after replication completes does the success response reach the producer. That extra round trip is the cost.

Now the leader can die and a follower that holds the message takes over, so nothing is lost.

Produceracks=allBroker 1LeaderBroker 2FollowerBroker 3M
1 / 4

In short

the safest and the slowest. Use it where loss is unacceptable — payments, orders.

02 Understand It Simply

For Everyone
🔑How It Works

acks sets what must finish before a send counts as successful: 0 waits for nothing, 1 waits for the leader's write, and all waits until the in-sync replicas have stored it too.

💡In Plain Words

acks decides when a write is answered as successful.

0 waits for no response at all, so a dropped connection goes unnoticed.

1 confirms only the leader broker's write, so if the leader dies before the followers replicate, that message is gone.

all responds only once the ISR — the caught-up replicas — have stored it, so it survives losing a broker.

Pick based on whether the data can afford to disappear.

📍Where It's Used
  • Separating settings for lossy data (logs
  • metrics) from critical data (payments)
  • and tuning the throughput/latency/durability trade-off

03 Frequently Asked Questions

FAQ
What is Producer & acks?+

A producer chooses how far a message must be stored before it counts as a success. acks=0 waits for nothing and is fastest but never learns whether a broker received it; acks=1 counts the leader's write as success, so a leader failure can lose it; acks=all needs the replicas to have stored it too — the safest and the slowest.

Where is Producer & acks used?+

Separating settings for lossy data (logs, metrics) from critical data (payments), and tuning the throughput/latency/durability trade-off.

What's a simple analogy for Producer & acks?+

acks sets what must finish before a send counts as successful: 0 waits for nothing, 1 waits for the leader's write, and all waits until the in-sync replicas have stored it too.