Retry with Exponential Backoff

Abhinav
Oct 25, 2023

--

There can be scenarios where your application is talking to another app or service that might be having a transient failure.

For example, your app might be making a call to the wallet service to update the user’s balance. But the wallet service might be down, or simply just undergoing maintenance.

In this case, a common technique used is retry with exponential backoff. When a request fails with a transient failure (network error / 5xx errors), you can implement an exponential backoff, that is — if the first retry is after 1 second, the second will be after 2 seconds, then 4 seconds and so on. Some systems add a constant timeout, and a randomness factor to avoid overwhelming the other system.

A common example of retry with exponential backoff is the Gmail UI when it tries to reconnect to the internet.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Abhinav
Abhinav

Written by Abhinav

Educator, Founder @ Interleap

No responses yet

Write a response