Producer Acknowledgement

Producers can choose to receive acknowledgement of data writes through three different levels:

  1. acks=0 (Fire and Forget)

    • Producer won't wait for acknowledgement
    • No acknowledgment required from broker
    • Highest throughput but possible data loss
    • Lowest latency but no durability guarantees
    • Message loss possible if broker fails
  2. acks=1 (Leader Only)

    • Producer waits for Partition Leader acknowledgement
    • Leader acknowledges without waiting for followers
    • Limited data loss possible if leader fails before replication
    • Balance of throughput and durability
    • Better durability than acks=0
  3. acks=all (All In-Sync Replicas)

    • Requires Partition Leader + all In-sync Replicas acknowledgement
    • Strongest durability guarantee
    • Highest latency
    • Works with min.insync.replicas for additional guarantees

Impact on Durability

The acks setting directly impacts Topic Durability. When used with min.insync.replicas, it provides the strongest durability guarantees. For example, with acks=all and min.insync.replicas=2, we need at least 2 brokers available to accept writes.

References

Flashcards

What are the three possible values for producer acks?:: acks=0 (no ack), acks=1 (leader only), acks=all (all replicas)

Which acks setting provides the strongest durability guarantee?:: acks=all, especially when combined with min.insync.replicas

What is the trade-off when using acks=all?:: Highest durability but also highest latency since we wait for all replicas to acknowledge

With acks=all and min.insync.replicas=2, how many brokers can fail before producers can't write?:: 1 broker - we need at least 2 brokers available to meet the min.insync.replicas requirement