Amina Bešlija
Amina Bešlija

How to implement an exponential backoff retry strategy in Javascript

Backoff algorithm A Javascript application made a fetch call to a remote server and it failed. How should it retry the request so that it eventually succeeds while also minimizing the calls made? A backoff algorithm makes sure that when a target system can not serve a request it is not flooded with subsequent retries. It achieves this by introducing a waiting period between the retries to give the target a chance to recover. The need for a backoff builds on the observation that a service is unavailable when it is overloaded and sending more requests only exacerbates the problem. When all callers temporarily cease adding more load to the already overloaded service usually smooths the traffic spikes with only a slight delay.


How to implement an exponential backoff retry strategy in Javascript #javascriptba #javascript #nodejs #reactjs #angularjs #vuejs #meteorjs #typescript #jquery #emberjs #denojs #bosnia