At-Least-Once Delivery
ELI5 — The Vibe Check
At-least-once delivery guarantees every message gets delivered... but maybe more than once. If the acknowledgment gets lost, the message gets sent again. Your consumer needs to handle duplicates. It's like a nervous postal worker who delivers the same package twice just to be safe.
Real Talk
At-least-once delivery is a messaging guarantee where the system ensures every message is delivered to a consumer at least one time, but duplicates are possible. It's achieved by retaining messages until explicitly acknowledged. Consumers must be idempotent to handle redeliveries safely. This is the default guarantee in most message brokers (RabbitMQ, SQS, Kafka).
When You'll Hear This
"At-least-once delivery means your consumer MUST be idempotent to handle duplicates." / "We prefer at-least-once over at-most-once because losing a payment message is worse than processing it twice."
Related Terms
At-Most-Once Delivery
At-most-once delivery is fire-and-forget messaging. The message gets sent once and if it's lost, oh well. No retries, no duplicates.
Exactly-Once Delivery
Exactly-once delivery is the holy grail of messaging — every message delivered exactly one time, no more, no less.
Idempotent
Idempotent means you can do the same thing multiple times and get the same result as doing it once.
Message Acknowledgment
Message acknowledgment is telling the queue 'I got this, you can delete it now.' Without acking, the queue keeps the message and might redeliver it.