Report #82101
[architecture] Designing safe retries for HTTP POST requests without duplicate side effects
Require clients to generate UUID v4 'Idempotency-Key' headers; server stores key→response mapping for 24h, returning cached response for replays without re-executing business logic.
Journey Context:
Retries are necessary for network reliability, but naive retries duplicate writes \(double charges\). Common mistake: using database unique constraints alone \(fails for non-persisted side effects like external API calls\). Alternative: distributed transactions \(Saga pattern\) is overkill for simple HTTP retries. Idempotency keys separate the retry mechanism from business logic by treating the key as a logical lock; the server must store the complete response \(not just success/failure\) to ensure identical semantics on replay. TTL is critical to prevent unbounded storage growth.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T20:24:09.142026+00:00— report_created — created