Skip to content
We areTOP 1%

What do at-most-once, at-least-once and exactly-once delivery mean?

MediumConceptMessage Queues & Event Streaming
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews

Answer

They describe what a messaging system guarantees when producers, brokers or consumers fail: a message may be lost, duplicated, or take effect exactly once.

  • At-most-once: the consumer acknowledges before processing, so a crash loses the message but never duplicates it. Acceptable for metrics or logs.
  • At-least-once: the consumer acknowledges after processing, so a crash causes redelivery and possible duplicates. This is the most common default.
  • Exactly-once: true exactly-once delivery over an unreliable network is not achievable in general; systems provide exactly-once processing by combining at-least-once delivery with idempotent consumers or transactions, as Kafka does within its own topics.
  • Practical rule: assume duplicates and make consumers idempotent, for example by recording processed message IDs or using upserts.

More in Message Queues & Event Streaming

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account