How do I design retries and dead-letter handling?
Practice this questionWANT TO UNDERSTAND THE CONCEPT FIRST?Learn How do I design retries and dead-letter handling?
Definition:
Retries repeat failed work in the hope that a temporary problem has passed. Backoff spreads attempts over time, jitter avoids synchronized retry bursts, and a dead-letter queue stores work that exceeded its retry policy. Without limits, retries can turn a small outage into sustained overload.
Key points:
-
Retry temporary failures with exponential backoff, random jitter and a limit.
-
Respect provider rate limits; avoid retrying permanent validation failures.
-
Send repeatedly failing messages to a dead-letter queue for investigation and controlled replay.
-
A timeout after sending an external request means the result may be unknown, not that the external action definitely failed.
Interview point:
- Classify failures as permanent, temporary or uncertain before deciding whether and how to retry.
Adapted from 07_SYSTEM_DESIGN_ARCHITECTURE.md · “How do I design retries and dead-letter handling?”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.