DEV Community

Discussion on: How to handle API downtime with 2 lines of code

 
frenchcooc profile image
Corentin

Retry is one simple feature to handle an API downtime, but it's surely not the only thing that will help your app to stay up.

  • Caching is a very good solution as well, while you might need some data validation at some point.
  • Using a circuit breaker is also great. It adds some more logic to a retry-mechanism and avoids tripling the bandwidth as you mentioned.

There's a great article on Dev.to on the main mechanisms to improve reslience on your app. At Bearer, we're starting with retry, but we are planning to add them all to our Agent.