News for hackers. Stuff that matters.
Re:You Cannot Have Exactly-Once Delivery by paxys on Wednesday March 01, 2023 @02:25PM (#34987021)
So, the opposite of exactly once
Re:You Cannot Have Exactly-Once Delivery by fizwhiz on Wednesday March 01, 2023 @02:33PM (#34987145)
With idempotence, you shift the problem from "deliver X exactly once" to "make it seem like X was delivered exactly once". In most systems, exactly-once is really "effectively exactly once".
Re:You Cannot Have Exactly-Once Delivery by paxys on Wednesday March 01, 2023 @02:38PM (#34987197)
That's my point. You are simply converting the problem to a new form, not actually solving it.

Hey here's a solution to the halting problem – always assume yes, and then figure out the edge cases. How do you do that? Well that's on you, I did my job.

Re:You Cannot Have Exactly-Once Delivery by nawgz on Wednesday March 01, 2023 @02:54PM (#34987400)
Idempotency - famously complex. No one has ever successfully implemented it, great point.
Re:You Cannot Have Exactly-Once Delivery by paxys on Wednesday March 01, 2023 @03:00PM (#34987492)
If you don't think idempotency can be complex then you haven't really worked on serious distributed computing problems.
Re:You Cannot Have Exactly-Once Delivery by nawgz on Wednesday March 01, 2023 @03:10PM (#34987596)
If you don't think your analogy is a miss then you haven't really read any serious literature.
Re:You Cannot Have Exactly-Once Delivery by burnished on Wednesday March 01, 2023 @03:43PM (#34988053)
Converting a problem to a new form that you know how to better solve, or at least hope is more tractable, is a time honored mathematical and CS tradition
Re:You Cannot Have Exactly-Once Delivery by sokoloff on Wednesday March 01, 2023 @02:30PM (#34987097)
Not exactly. If you have a business problem where you’re thinking “But I really, really need the effect of exactly-once; what can I do?”, GP’s post has the answer.
Re:You Cannot Have Exactly-Once Delivery by fsckboy on Wednesday March 01, 2023 @02:40PM (#34987222)
OP's idea should be

idempotence + at least once

idempotence isn't necessarily commutative.

Re:You Cannot Have Exactly-Once Delivery by echelon on Wednesday March 01, 2023 @02:31PM (#34987108)
No, if your datastore is online (the only way you're functioning anyway), store an idempotency key, vector clock, etc.

For single consumers, exactly once delivery may as well be a thing.

In active / active setups, there are other strategies.

Re:You Cannot Have Exactly-Once Delivery by naasking on Wednesday March 01, 2023 @03:08PM (#34987579)
It can be exactly once at the application level just not exactly once at the more fine-grained message level. The fact that it's not exactly once at that lower level doesn't really matter, the semantics at the application level is what we care about.
Re:You Cannot Have Exactly-Once Delivery by kybernetikos on Wednesday March 01, 2023 @04:57PM (#34988914)
Exactly. In practice there are probably a bunch of other things happening over the wire we also don't care about, handshakes and keepalives and negotiation and splitting and encryption and latency measuring and backpressure... It doesn't matter, in a variety of systems, at the application layer it is fine for the user to assume they will see a delivery to their code exactly once and that's what the user cares about. A delivery didn't mean some internal bytes travelled across the wire, it means your clients received a call.

That's why if you search for exactly once delivery you'll see a bunch of products claiming to have it (e.g kafka).