Netilion API Best Practices
When using the Netilion API, as with any API, it is essential to design your applications with fault tolerance in mind. The Netilion API is a shared ressource, we want to ensure that all users have a good experience. Thus we limit the number of requests per user or API key.
Below are some best practices to ensure the robustness and resilience of your application. The following list is not exhaustive and there are of course many other principles to follow to create good software that are not explicitly mentioned here.
Graceful Degradation
You should anticipate that API endpoints might fail or return unexpected results. Design your application to handle these scenarios gracefully. Implement fallback mechanisms or alternative paths when an endpoint fails. If your application uses different endpoints in a specific order, consider how to react if some endpoints are not available.
Retry Strategies
Implement retry logic for failed API requests. If an endpoint doesn’t respond, retry the request after a delay. Use exponential backoff to prevent overwhelming the server with repeated requests. Gradually increase the delay between retries.
Circuit Breaker Pattern
Implement a circuit breaker mechanism to prevent continuous requests to a failing endpoint. If an endpoint consistently fails, open the circuit (stop making requests) for a predefined period. After that, periodically check if the endpoint has recovered.
Timeouts
Set reasonable timeouts for API requests. If an endpoint takes too long to respond, cancel the request and handle the timeout gracefully.
Monitoring and Alerts
Regularly monitor your application for performance and availability. Set up alerts to notify you when an endpoint fails or responds unexpectedly. This allows proactive investigation and mitigation.
We offer status.netilion.endress.com where you can subscribe to the status of the Netilion API.