Strong dependency isolation

Updated at:

A strong dependency is a third-party application, component, or internal method that can disrupt your entire application if it fails. For strong dependencies, configure fencing rules to protect system stability.

How it works

If a strong dependency becomes unstable, you can limit its concurrency by configuring a fencing rule based on the number of concurrent threads. This fences the unstable dependency. After you configure this rule, you do not need to perform thread pool fencing. AHAS controls the number of threads for the resource. When the number of requests exceeds the threshold, AHAS rejects any new requests until the stacked threads finish processing. This achieves the effect of semaphore fencing.

When the number of threads exceeds the threshold, a fast-fail strategy can effectively prevent your application from being affected by slow calls.

Note

Fast-fail is the default throttling method. When the queries per second (QPS) exceed the threshold of a rule, new requests are immediately rejected by throwing a FlowException. This method is suitable when you know the exact processing capacity of your system, for example, after determining the system's capacity through stress testing.

Example

For example, an interface named function_0 in application A is unstable and experiences slow SQL statements.

For this scenario, you can set a fencing rule for the call with the threshold type set to Thread Count and the threshold set to 0. For more information, see Configure fencing rules.

After you configure the rule, the function_0 method is throttled. The status of each SQL call is shown in the following figure.