A weak dependency is a non-critical service that does not affect the main process flow if it fails. If a weak dependency becomes unstable, you can configure degradation rules to protect your system's stability.
Background information
In business applications, services often depend on remote services, databases, or third-party APIs. For example, a payment service might call a payment gateway's API. However, the stability of these dependencies is not guaranteed. If a dependency becomes unstable, the response time for requests and method calls increases. This causes threads to become stacked. Eventually, this can exhaust the application's thread pool and make the application unavailable.
In a complex call chain, instability in one link can cascade and make the entire chain unavailable.
To handle these situations, you can use the application protection feature of Application High Availability Service (AHAS) to configure degradation rules for your dependencies and ensure system stability.
How it works
If an application relies on multiple downstream services that are weak dependencies, slow service calls can severely impact the application. You can configure degradation rules for the client based on the average response time or error rate. When the average response time or error rate of a downstream service call exceeds the configured threshold, AHAS degrades the call. AHAS then rejects subsequent calls to protect the application from bottlenecks.
For more information, see Configure circuit breaking rules.
You can use the Fallback feature to provide custom logic for handling degraded calls.