Skip to the page

Reliability and scale · senior

Retry storms, partner floods and graceful degradation

Overload spreads when callers retry, share pools or wait on optional services. Use limits per client, bulkheads, bounded queues, retry budgets, circuit breakers and fallbacks agreed in advance.

The notes

What you must know

  • A partner bug floods the API: confirm with per-client metrics by API key, lower that key limit or block the endpoint, call the partner, and shed low-priority traffic.
  • Why the limiter missed: it limits per IP not per key, the limit was too high, it runs after expensive work, or it fails open.
  • Shared resources: one thread pool, database pool or queue for every client causes head-of-line blocking. Use bulkheads (separate pools or queues per tier or partner), per-tenant quotas and priority queues.
  • Backpressure: bounded queues and concurrency limits; reject early with 429 or 503 instead of unbounded queueing. Ask partners for exponential backoff with jitter and Retry-After, and webhooks instead of polling.
  • Retry storm: callers retry at once at every layer, so load stays far above normal even after the trigger is gone (a metastable failure). Three layers with three attempts each means 3 x 3 x 3 = 27 calls to inventory for one tap.
  • Recovery: turn off retries by config, open circuit breakers, shed load at the edge, bring capacity up while traffic is held back, ramp traffic gradually, drop queued requests whose callers gave up.
  • Callers: timeouts based on downstream p99; retries at one layer only, only for idempotent calls, with capped exponential backoff and jitter; a retry budget (retries no more than about 10 percent of requests); deadlines passed down. Circuit breaker: after errors cross a threshold fail fast, then send a few test calls (half-open).
  • Home page down because recommendations are down: a synchronous call to an optional service with a long timeout and no fallback ran out of threads. Sort features by criticality. Optional calls get tight timeouts (100 to 200 ms), run in parallel, sit behind a circuit breaker and have a fallback (popular items, last good response, hide the widget). Prepare kill switches and static fallbacks on the CDN, and practise on game days. Payments cannot be faked: never show success without confirmation.

The red pen

Common traps: mistake → fix

  • Mistake: Add more instances alone fixes a retry storm

    Fix: the retries still multiply.

  • Mistake: Scale up to absorb a partner bug

    Fix: fix the cause and limit the client.

  • Mistake: Long timeouts on optional calls

    Fix: they hold threads; use 100 to 200 ms.

  • Mistake: Fallbacks never tested

    Fix: they fail when needed.

Easy to hard

Questions interviewers ask, easy to hard

  1. A partner bug floods our API. What do you do?
  2. A retry storm keeps a service down. How do you recover and prevent it?
  3. The home page is down because recommendations are down. Why?
  4. What is a circuit breaker?
  5. What is a bulkhead?

Your first interview is free

Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.

Start your free interview