“This is the 11th day of my participation in the First Challenge 2022. For details: First Challenge 2022.”

Demotion, same old routine, figure out what our goal is. “Downgrade” is just an action, not a goal, without the target of action is easy to deformation, but also easy to run off.

Downgrading is a means of improving system availability. Before, some students were confused about the difference between “availability” and “reliability”. Take degradation for example: Before degradation is triggered, availability and reliability are the same. Once a downgrade is triggered, availability remains unchanged and reliability degrades.

So our goal is to improve system usability. Having a sense of purpose makes you feel much better.

Easiest way to downgrade: (1 minute)

If (isDegradation){… }else{… }, in a minute, don’t look at this crude, when it’s urgent to do this. Also do not try to introduce external dependencies to switch, any extra action in a particularly urgent situation is a burden.

Urgent but not so urgent solution :(10 minutes, external dependencies you want a brief test?)

With my group of MCC or Lion configuration platform, configuration of a switch, combined with the above scheme is a basic downgrade scheme.

Solution with a bit of time: two days to design the data structure and buried points within the project?

Design the data structure of the configuration platform to provide multiple demotion strategies and combine demotion switches. Such as:

Group: 3,1,2; // Demote by group with the latter overtaking the former

[group] // Demote switch group definition

1[keyA]=true;

2[keyA]=false;

2[keyB]=true;

3[keyA]=true;

3[keyB]=true;

[single] // Single key demote switch definition

keyA=true;

keyB=false;

[time] // Defined by the time degrade switch

key1=”2020-04-30 12:00:00~2020-04-30 20:30:00#3000″

The above is an example, it is possible to have more design, such as the value of true or false into a number within the range of 0 to 10000, which represents the scale of degradation, etc., so as to ensure the availability of the basis, and then control the decline of reliability.

Your boss gives you a plan for specific hours :(start at a week)

In addition to the above data structure design and buried point in the project, need to do some automation, with the Lion monitoring service interface service and Avatar, the whole link pressure measurement, adjustment test relegation switch changes and system bottleneck, completes the curing reversion strategy, make automatic relegation strategy into service. Note that the manually controlled downgrade switch is set to the highest level, in case there is no means to deal with the time of misdescent.

If you want to do more projects to jointly downgrade, the principle is similar, you can do a multi-service access layer to do downgrade control, but also let multiple projects share a set of special program downgrade tools.

Of course, it depends on the reliability of external service configuration system. If you are not sure, you can also do some other local cache policy or timing push-pull configuration scheme or service.

Once the above is done, basically the service availability is basically acceptable. But when the system degradation is done, the reliability guarantee should also be done.

I have shared some practical ideas. I believe the students in our group can solve the details in the process of practice.