
When Webhooks Retry, Users Shouldn’t Notice: Idempotency Locks with Redis
This article explains how we use a short-lived Redis idempotency lock to protect external vendor transfer webhooks from race conditions, duplicate retries, and out-of-order delivery. By using an atomic SetNx cache key with a bounded TTL, we ensure each transfer status is processed exactly once within a retry window, preventing duplicate database updates, events, and side effects while keeping the system resilient and recoverable.