Error Response Handling
This section details a simple paradigm for error response handling.
Applications based on request/response pairs may face a myriad of issues because of network and internet connectivity causing request timeouts due to network throttling and overloading. Many hardware problems, such as load-balancer faults and switch timeouts, can also cause transparent request timeouts. For these reasons, an application using the Apstrata database service should implement a request retry strategy.
The following is an example of a simple strategy for exponential back-off in request retries. The back-off strategy is dependent on the application’s business needs. It stops retrying a request after 5 tries in order to avoid network congestion:
Do not retry client errors. Client errors indicate that Apstrata found a problem with the client request and the application should address the issue before submitting the request again. You should, however, retry requests if server errors occur.