Exactly-once delivery is the strongest correctness guarantee a streaming pipeline can provide: each event produces its effect on the downstream system exactly once, regardless of failures, retries, or reprocessing. It is also the hardest to achieve, requiring coordination between the event source, the processing engine, and the output sink — any of which may fail and require retry. Understanding the three delivery semantics — at-most-once, at-least-once, and exactly-once — and knowing when each is achievable is essential for designing streaming pipelines that meet correctness requirements without unnecessary operational complexity.
True exactly-once requires that the commit of processed offsets and the write of results to the destination happen atomically — both succeed or both fail, with no state where the results are written but the offsets are not committed (causing re-delivery) or the offsets are committed but the results are not written (causing lost events). In practice, exactly-once is achieved in most Kafka-to-sink pipelines through a combination of at-least-once delivery and idempotent sink writes — effectively-exactly-once semantics that are indistinguishable from true exactly-once in their final observable effect.