Monedula

Scenario 01.1.1 · acks=0: fire and forget

Kafka producer acks=0: fire and forget, silent data loss

Producers & EOS · Intermediate · about 2 min · Apache Kafka 4.3

The producer never waits for an ack (status ‘sent’) - lowest latency, but a record on a leader that dies before replicating is silently lost.

Run this scenario in the playground

Leader died before O2 replicated · O2 lost silently. t+2.400s

O2 was on the leader only when it was killed. A new leader is elected from a follower that never received O2, so O2 is gone - and with acks=0 the producer was never told (still ‘sent’, no error). Fire-and-forget trades durability for latency.

Open at this step: step 4, Leader died before O2 replicated · O2 lost silently

What you start with

The producer's acks setting controls how much durability it waits for. With acks=0 the producer dispatches a record and moves on immediately, never waiting for the broker to confirm the write. Watch O1 replicate safely, then watch O2 vanish when its leader is killed before replication - the producer is never told.

Step by step

  1. Idle · producer ready (acks=0) t+0.000s Three replicas, a producer configured acks=0. Watch the producer's status as it sends. Open at this step: step 1, Idle · producer ready (acks=0)
  2. O1 dispatched · status ‘sent’ t+0.900s With acks=0 the producer wrote O1 to the leader and immediately moved on - its status is ‘sent’, not ‘ok’. It never waited for an acknowledgement, so this is the lowest-latency mode. Open at this step: step 2, O1 dispatched · status ‘sent’
  3. O1 replicated (lucky) t+1.500s The followers fetched O1 and the high watermark advanced - O1 is durable. But the producer never knew or waited; acks=0 gives no commit signal. Open at this step: step 3, O1 replicated (lucky)
  4. Leader died before O2 replicated · O2 lost silently t+2.400s O2 was on the leader only when it was killed. A new leader is elected from a follower that never received O2, so O2 is gone - and with acks=0 the producer was never told (still ‘sent’, no error). Fire-and-forget trades durability for latency. Open at this step: step 4, Leader died before O2 replicated · O2 lost silently

The takeaway

acks=0 gives the lowest possible latency at the cost of silent data loss: a record on a leader that dies before replicating is gone, and the producer never learns it failed.

Configs in this scenario

Embed this scenario

Paste this into a blog post, a course page or your team's docs. The scenario plays inside your page, and the link under it points readers to this walkthrough.

<iframe src="https://monedula.dev/kafka-simulator/embed/?scenario=01.1.1" title="Kafka Simulator: acks=0: fire and forget" width="100%" height="520" style="border:1px solid #d0d0d0;border-radius:8px" loading="lazy"></iframe>
<p><a href="https://monedula.dev/kafka-simulator/scenarios/acks-0-fire-and-forget/">Kafka producer acks=0: fire and forget, silent data loss</a></p>

Further reading

Apache Kafka documentation

Troubleshooting

More in Producers & EOS

All scenarios