IdempotentWrite
Safe retries via unique keys
Mechanism
A technical primitive where every write request includes a unique 'Idempotency Key'. The receiver maintains a Cache of processed keys. If it receives a duplicate key, it returns the stored result without re-executing the side effects. This makes 'At-Least-Once' delivery safe. It uses a keyed StateLock to deduplicate requests, ensuring only the first write executes while subsequent ones return the cached result.
Invariants
- Idempotence: Apply(Apply(Req)) stands in Equivalence with Apply(Req) — a repeated key returns the first result rather than executing again.
- Safety: Duplicate requests trigger zero additional side effects
Preconditions
- Receiver has state storage for keys
Postconditions
- Action executed exactly once (logically)
Failure modes
- Key collision (two different requests use same key).
Where this came from
—
Builds on
- Equivalence references
- Cache references
- StateLock references
Used by
- StateSnapshot references
Related
Identity
- Ref:
IdempotentWrite#7226 - Hash: sema:IdempotentWrite#mh:SHA-256:7226e14f5caed42394b33c28989972451a03b43ba531e8cb6a9975a0fee4ab2c
- Library: bootstrap 0.11.0, root a6a3d1ff0f98
- License: Not stated; check the repository