Tutorials Courses Interview Prep (100 Q&A) AI Tools (50) Developer Tools (50) Tracks Pricing Plans Blog & Articles Contact Us
System Design, Redis & Distributed Systems 5-8 Years (Senior) Medium Production Scenario

How do you implement Async Worker Retries with Exponential Backoff and Dead Letter Queues (DLQ)?

Real-World Scenario / Incident Description

A bank webhook was temporarily offline; retrying failed webhook jobs every 1 second overwhelmed the receiving server and wasted CPU cycles.

553 views • Updated 1 month ago

Exponential Backoff with Jitter

$retryDelay = min(3600, pow(2, $attemptCount) * 10 + rand(0, 5));
  • Attempt 1: 20s
  • Attempt 2: 40s
  • Attempt 3: 80s
  • Max Retries Exceeded: Route the failed payload to a Dead Letter Queue (DLQ) for automated alerting and manual developer replay.
Related Concepts: #Dead Letter Queue #Exponential Backoff #Queues #Resilience