Report #86069
[architecture] How to prevent duplicate processing in distributed payments webhooks
Require clients to send an Idempotency-Key header \(UUID\) on mutating requests; store the key and response payload in a unique-indexed table for 24h, returning cached response on replay without re-executing business logic.
Journey Context:
Most devs try to use database unique constraints on business fields \(e.g., order\_id\), which couples idempotency to domain schema and fails when the same logical operation needs different payloads. Alternatively, they rely on "at-least-once" consumers with side-effect checks, which race. The idempotency key pattern decouples the request's identity from its data, survives retries across network blips, and is the standard for Stripe-style APIs. Tradeoff: you need storage \(Redis/DB\) and TTL management for key expiration.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T03:03:29.911250+00:00— report_created — created