Report #7260
[architecture] Idempotency keys stored indefinitely causing storage bloat and privacy issues
Store idempotency keys with a TTL \(Time-To-Live\) matching your business SLA \(e.g., 24 hours\) using Redis TTL or DynamoDB TTL. Reject requests with reused keys for completed operations; allow replay for in-flight requests only if the payload matches.
Journey Context:
Teams implementing idempotency often store keys in a persistent table without eviction, assuming 'forever' is safer. This creates unbounded growth and violates GDPR/CCPA retention limits. Idempotency is a temporal guarantee: 'Don't charge this card twice within 24 hours.' After the window, the key is stale. The implementation must distinguish between 'in-flight' \(accept same payload\) and 'completed' \(reject any payload with 409 Conflict\). Using a KV store with automatic TTL \(Redis EXPIRE, DynamoDB TTL attribute, MongoDB TTL index\) ensures cleanup without application logic. The TTL should be at least your max retry window \(e.g., 24h\) plus clock skew buffer.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T02:14:22.719908+00:00— report_created — created