Course contentsShow
← System Design
Lesson 1021 of 1,91926. Idempotency and RetriesFree lesson

Immediate Retry vs Delayed Retry

Comparing instant retry attempts versus waiting before retrying, and when each approach is appropriate.

Immediate Retry vs Delayed Retry

You'll learn: When to retry a failed request instantly versus waiting before trying again.

When a distributed system request fails, you have two basic timing strategies for retries: try again immediately, or wait before retrying.

Immediate Retry

An immediate retry attempts the request again with minimal or no delay (typically 0-10ms). This works well when:

  • The failure was likely transient and fleeting (momentary network blip, brief connection reset)
  • The downstream service recovers instantly from temporary issues
  • Time is critical and you can't afford to wait
  • You're confident the request won't make the problem worse

Analogy: Like redialing a phone call immediately when it drops mid-ring—it might connect the second time.

However, immediate retries can be dangerous. If the failure was due to an overloaded server, hammering it with instant retries makes the situation worse (like a crowd pushing harder on a jammed door).

Delayed Retry

A delayed retry waits before attempting again (typically starting with 100ms-1s and increasing). This is appropriate when:

  • The downstream service needs time to recover (restarting, clearing queues)
  • The failure indicates resource exhaustion (rate limits, overload)
  • You're part of a large client pool that might thundering-herd
  • The operation is background work where latency is acceptable

Delays are often combined with exponential backoff (doubling the wait time) and jitter (randomization) to prevent synchronized retry storms.

Analogy: Like waiting a few minutes before calling a busy restaurant back, rather than redialing every second.

When to Choose

Use immediate retries sparingly—typically just 1-2 attempts for truly transient errors like connection resets. Default to delayed retries for most failure scenarios, especially timeouts, rate limits, and server errors.

Key Takeaway: Immediate retries work for fleeting transient failures but risk overload; delayed retries give systems time to recover and prevent thundering herds, making them the safer default choice.