Skip to main content

Question 38 of 50

What is At Most Once?

Mid-levelSenior

Question

"What is the At Most Once guarantee?"

What the interviewer wants to assess

Whether you understand that this guarantee trades loss protection for simplicity/speed — and whether you can say when (rarely) it's acceptable.

Resposta rápida

At Most Once means the message is delivered at most once — never duplicated, but it can be lost. It happens when the offset commit (or the producer's ack) occurs before any confirmation that processing actually succeeded.

Resposta nível Sênior

On the producer side, acks=0 (or acks=1 with no retry-failure handling) tends toward this guarantee — the message may never reach the broker without the producer knowing. On the consumer side, auto commit (or manual commit done before processing finishes) has the same effect: if the consumer crashes after the commit but before finishing processing, that message will never be reprocessed, because Kafka already considers it consumed. This guarantee is rarely acceptable in financial systems — silently losing a payment event is generally worse than processing it twice (which is at least fixable with idempotency).

In-depth explanation

See "At Most Once" in Chapter 10.

Exemplo financeiro

A non-critical usage-metrics collection system can accept At Most Once: occasionally losing a click event has no meaningful business impact, and the simplicity/speed trade-off pays off.

"At Most Once is always the worst choice"

It's not always wrong — for low-value data where occasional loss is acceptable and performance matters more than completeness, it's a valid choice. The mistake is using it by default in flows where loss is unacceptable, without that conscious analysis.

Pode vir a seguir

Likely follow-ups: "what is At Least Once?" and "what is Exactly Once?".

Related chapters