Bottom data:

When the service is degraded, the default data will be returned automatically, such as queuing page (try again later), no stock, load abnormal page (activity is too hot, please try again, network exception).

Back-pocket logic:

Switch from complex to simple services when the service is degraded

Fuse:

Before the service invocation, check the service, after the service invocation, count the call result, maintain the service state, open, half open, close

Manual downgrade:

The configuration center manually configures the service degrade switch status, compares the fuse parameter Settings, and directly shuts down the service

The configuration center manually configures the overall architecture downgrade level, and fuses shut down services in batches

Automatic relegation

Timeout downgrade:

When the service request times out or the number of retries exceeds the threshold set by the configuration center, the service is degraded, and the bottom-pocket logic is automatically invoked this time and next time

Number of failures degraded:

When the number of service invocation failures exceeds the threshold set by the configuration center, the service is degraded, and the next time and the next time the back-pocket logic is automatically invoked

Fault degradation:

When the service hangs, network problems, status code exception, RPC return exception, service degradation, this and the next automatic call to the bottom of the logic

Downgrade recovery:

The fuse after a period of time, put a few requests, check the service, if normal, restore the half-open state, after a period of time, service restore the open state

hystrix: 

1, import hystrix dependency, method implementation class annotation Hystrix timeout logic method, provide timeout bottom logic

2, custom timeout return logic factory class, when the request times out, directly return to the bottom of the logic

3, HystrixCommand annotation form, configure the bottom of the pocket logic and implement the bottom of the pocket logic

Configuration degradation:

Configuration register center downgraded strategy, degradation parameters, the service start pull configuration center downgraded strategy, degradation parameter information, locally stored a cache, configuration center configuration changes, send modify configuration data to the service After the service invocation, fuse statistics service, through degradation parameters, and custom relegation strategy, modify the service state, or the use of relegation strategy.

Demotion strategy:

1. Page degradation – disable button clicking on visual interface and adjust static page

2. Delay services – such as delayed processing of scheduled tasks and delayed processing of messages after entering MQ

3. Write degrade – directly disallows service requests related to write operations

4. Read downgrade – Directly disallows relevancy service requests

5. Cache degradation – Use caching to degrade some frequently read service interfaces

6, thrown exception

7, returns NULL

8. Invoke Mock data

9. Call Fallback processing logic

Grading downgrade:

Blue Storm – Indicates the need for minor downgrades of non-core services

Yellow Storm – Indicates a moderate downgrading of non-core services

Orange Storm – Indicates the need for large-scale downgrades of non-core services

Red Storm – Indicates that all non-core services must be downgraded

The configuration center configures the hierarchical downgrade threshold, configures the service importance level, and the gateway monitors the service architecture load level and traffic statistics. When the traffic or load exceeds the threshold, the system enters that state.

Compensation scheme:

After the use of compensation mechanism, can be automatic or manual compensation.

1. Fuse uses delay queue to record degraded service write requests, waits for the service to open, and automatically sends the write request interval classes in delay queue to the opened service in batches.

2. The fuse uses the storage mode to record the degraded service write request. By logging in the compensation management interface, read and compensate the write request, and compensate the online data; Or degraded service write requests, written to files, compensated by scripts