← Lessons

quiz vs the machine

Silver1080

Concurrency

At Most Once Semantics

Deliver each message zero or one times, never twice, by refusing to retry.

4 min read · intro · beat Silver to climb

What at most once means

At most once delivery promises that a message is processed either zero times or one time, but never more. The system accepts the risk of loss to eliminate the risk of duplicates.

How it is achieved

The sender fires a message and does not retry on uncertainty.

  • It sends once and forgets, or sends and gives up after the first attempt.
  • If the acknowledgement is lost, it assumes the message is gone rather than resending.

Because there is no retry, a copy can never be delivered twice. The tradeoff is plain: when an ack is lost but the message actually arrived, the sender wrongly treats it as lost, yet the receiver processed it.

When it fits

At most once suits work where a missing item is cheap but a duplicate is harmful or confusing:

  • Best effort metrics where one dropped sample does not matter.
  • High volume telemetry where exact counts are unnecessary.

Key idea

At most once trades the possibility of loss for a firm guarantee of no duplicates by never retrying an uncertain send.

Check yourself

Answer to earn rating on the learn ladder.

1. What risk does at most once delivery accept?

2. Why can at most once never produce a duplicate?