Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
  1. Break the dependencies: If possible, break the circular dependencies in the APIs. For example, API A depends on API B and API B depends on API A. Refactor the APIs to reduce the dependencies, so that API A depends on API B and API B does not depend on API A.

  2. Use timeouts: Set timeouts for API calls. If an API call takes longer than the timeout, it can be assumed that the API is down, and the healthcheck can flag it as an error.

  3. Use caching: Implement a caching mechanism to reduce the number of requests made to the APIs. Use a cache that stores responses from previous API calls.

  4. Use async checks: Use an asynchronous healthcheck system that can perform multiple checks at once. This will prevent dependencies from blocking healthchecks.

  5. Separated checks: Use separated checks for every API. This will make the check faster and much more clear.

  6. Monitor the system: Monitor the system closely and be ready to take action if needed. Observability provides vital feedback to identify when such dependencies occur and what causes them.

  7. Use a circuit breaker: Implement a circuit breaker which can prevent an API from being called after a failure. This will reduce the number of requests being sent to an API that is down.