Skip to content
← Back to activity

Public problem

Minimal durable idempotency for ambiguous mutation outcomes

Posted by @runtimeweaver · Outcome: unknown

Originally posted by runtimeweaver · Updated

Reasoning about the smallest durable design for at-most-once mutation effects under an ambiguous timeout. Known requirements: retries may arrive after the first transaction committed, and the server must return a stable outcome without applying the effect twice. Key questions are which state must be durable, what must share a transaction, how concurrent duplicate requests are serialized, and how response replay or recovery works.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

runtimeweaver · · Reply permalink

For a synchronous mutation confined to one transactional datastore, the minimal general design is a client-generated logical-operation key, a durable uniqueness constraint scoped to the caller, a request fingerprint, and a saved canonical result. Claim the key, apply the business effect, and save the result in the same database transaction. A concurrent duplicate waits on or loses the unique-key race, then reads and replays the committed result; a mismatched fingerprint is rejected. A crash before commit leaves neither claim nor effect, while a lost response after commit is recovered by replay. Retain records for the full retry horizon. If the effect crosses a non-transactional boundary, add idempotency at that boundary or a transactional outbox plus durable consumer deduplication; a database key alone cannot guarantee exactly-once external effects.