The timeout pattern we implemented in the previous section is efficient at protecting the patience of our users and, ultimately, our Angular application. However, in the case that the API is not responding because something went wrong on the server side, let's say 80% of your server is down and the remaining 20% is trying to manage the load, your clients will most likely repeatedly retry the action that timed out. Consequently, this puts even more stress on our dying backend infrastructure.
A circuit is an automatic device for stopping the flow of the current in an electric circuit as a safety measure. Circuit breakers are used to detect failures and encapsulate the logic of preventing a failure from reoccurring constantly (during maintenance, temporary external system failure, or unexpected system difficulties).
Concretely, within the framework of an Angular...