Exactly-Once Delivery
ELI5 — The Vibe Check
Exactly-once delivery is the holy grail of messaging — every message delivered exactly one time, no more, no less. In distributed systems, it's technically impossible without some tricks like transactions or idempotency. It's like promising a package arrives exactly once in a world of unreliable roads.
Real Talk
Exactly-once delivery guarantees each message is processed exactly one time. True exactly-once is impossible in distributed systems (due to the Two Generals Problem), but it can be approximated using idempotent consumers, transactional outbox patterns, or Kafka's exactly-once semantics (EOS) which combines idempotent producers with transactional consumers.
When You'll Hear This
"Kafka's exactly-once semantics use transactional producers and consumer offsets together." / "We achieve effectively-exactly-once by combining at-least-once delivery with idempotency keys."
Related Terms
At-Least-Once Delivery
At-least-once delivery guarantees every message gets delivered... but maybe more than once. If the acknowledgment gets lost, the message gets sent again.
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.
Idempotency Key
An idempotency key is a unique ID you attach to a request so the server knows if it's a duplicate.
Transaction
A transaction groups multiple database operations into one all-or-nothing bundle. Either ALL of them succeed, or NONE of them happen.