Report #4296
[architecture] How to achieve exactly-once delivery in message queues
Accept that exactly-once delivery is impossible; implement idempotent consumers using idempotency keys stored in DB with unique constraints; design for at-least-once delivery \+ idempotent processing
Journey Context:
Teams waste months trying to build 'exactly-once' Kafka producers or using transactional outbox patterns to guarantee delivery. Distributed systems researcher Peter Bailis proved that network partitions make exactly-once impossible without sacrificing availability. The practical solution is: messages may be delivered multiple times \(at-least-once\), but processing them multiple times has no side effect. This requires the consumer to check 'have I processed msg\_id XYZ?' before doing work. Kafka's EOS \(Exactly Once Semantics\) is actually idempotent producers \+ transactional consumers - it still requires idempotent application logic.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T19:10:58.637645+00:00— report_created — created