zlacker

[return to "Idempotency keys for exactly-once processing"]
1. pyroli+7hg[view] [source] 2025-12-05 23:52:37
>>defly+(OP)
This article glosses over the hardest bit and bike sheds too much over keys.

> Critically, these two things must happen atomically, typically by wrapping them in a database transaction. Either the message gets processed and its idempotency key gets persisted. Or, the transaction gets rolled back and no changes are applied at all.

How do you do that when the processing isn’t persisted to the same database? IE. what if the side effect is outside the transaction?

You can’t atomically rollback the transaction and external side effects.

If you could use a distributed database transaction already, then you don’t need idempotent keys at all. The transaction itself is the guarantee

◧◩
2. hippo2+9ng[view] [source] 2025-12-06 00:40:39
>>pyroli+7hg
The external side-effects also need to support idempotency keys, which you propagate. Then you use something like a message queue to drive the process to completion.
◧◩◪
3. plaguu+nxi[view] [source] 2025-12-06 23:42:47
>>hippo2+9ng
and when one is a third party service that doesn't?
[go to top]