by cortesoft 6 hours ago

How is this different/better than something like using a SHA256 of the input key?

Edit: Just looked it up... looks like this is basically what a uuid5 is, just a hash(salt+string)

dmurray 4 hours ago | [-1 more]

This doesn't sound good at all. It's quite reasonable in many applications to want to send the same message twice: e.g "Customer A buys N units of Product X".

If you try to disambiguate those messages using, say, a timestamp or a unique transaction ID, you're back where you started: how do you avoid collisions of those fields? Better if you used a random UUIDv4 in the first place.

imron 2 hours ago | [-0 more]

You don’t generate based on the message contents, rather you use the incoming idempotent id.

Customer A can buy N units of product X as many times as they want.

Each unique purchase you process will have its own globally unique id.

Each duplicated source event you process (due to “at least once” guarantees) will generate the same unique id across the other duplicates - without needing to coordinate between consumers.