Edge and reliability / Advanced / 7 min
Timeouts, retries and circuit breakers
Watch retries turn a slow dependency into a retry storm, and a circuit breaker stop it.
Start the simulation → Change the load, break a part, watch what happens. Free, no sign-up.
In short
- What it is
- Timeouts, retries with backoff and jitter, and a circuit breaker that stops calling a failing dependency for a while.
- Why it matters
- A slow dependency can tie up all your threads and take your service down too (cascading failure).
- The trade-off
- Retries add load exactly when the dependency is struggling, so cap them; retried requests must be safe to repeat (idempotent).
- Say it in an interview
- "Short timeouts, at most 2 retries with exponential backoff and jitter, and a circuit breaker that fails fast and serves a fallback."
Check yourself
A dependency slows down and every caller retries 3 times immediately. What can happen?
Answer: A retry storm: load multiplies and the dependency can’t recover. Each failed call becomes several calls, pushing an already struggling service further past capacity.
What does a circuit breaker do when it is open?
Answer: Fails calls immediately without calling the dependency. It gives the dependency room to recover and gives users a fast answer or fallback instead of a timeout.
Why add jitter to exponential backoff?
Answer: To spread retries out so many clients don’t retry in synchronized waves. Without jitter, clients that failed together retry together, causing load spikes.