Report #9687
[architecture] Implementing idempotent APIs without storage limits or replay protection
Store idempotency keys with TTL tombstones \(mark consumed, don't delete\) and scope them to the requesting entity \(user/account\), never globally.
Journey Context:
Developers either store keys forever causing unbounded DB growth, or delete them immediately allowing replay attacks. The production-hardened approach uses tombstone records \(consumed=true\) with a long TTL \(days\), while the active key has a short TTL \(hours\). This prevents replay during the idempotency window without infinite storage. Scoping prevents User A's key from blocking User B's request \(security \+ collision safety\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T08:48:19.334568+00:00— report_created — created