# Delivery Guarantees — System Design: Architecture, Scale and Trade-offs

Source: https://www.skillbyai.com/en/system-design/sd-delivery-semantics

> Learn at-most-once, at-least-once and exactly-once delivery, and how idempotent consumers approximate exactly-once.

## Three guarantees

**At-most-once**: send and forget, message may be lost but never duplicated. **At-least-once**: retry until acknowledged, message may be duplicated but never lost. **Exactly-once**: each message has effect exactly one time — the hardest and most expensive to guarantee end-to-end.

## Registered mail vs a shout

At-most-once is shouting across a noisy room — fast, might not land. At-least-once is registered mail with return receipts — you keep resending until confirmed, so the recipient might get two copies. Exactly-once needs the recipient to also dedupe by a tracking number, effectively at-least-once delivery plus idempotent processing.

**Quiz:** Most real-world 'exactly-once' systems are actually built from which combination?

- [x] At-least-once delivery + idempotent consumers
- [ ] At-most-once delivery + retries
- [ ] A single global lock
- [ ] Two-phase commit across every service

*Answer:* At-least-once delivery + idempotent consumers. Delivering at least once and then deduping on the consumer side is the practical way most systems achieve exactly-once effect.
