This is the 15th day of my participation in the December Gwen Challenge. Check out the event details: The last Gwen Challenge 2021

The main purpose of the scheme design is to solve the problems caused by software system complexity. This article tries to introduce the source of complexity of solution design in the process of solution design.

The complexity of the

The complexity of high performance in a system is mainly reflected in two aspects:

  1. The complexity inherent in the pursuit of high performance
  2. The complexity of computer clustering in pursuit of high performance

Inside the computer, THE CPU speed is the fastest, the purpose of many stand-alone high-performance programs is to put the CPU performance as much as possible to play out. Common schemes are: multi-process, multi-thread, inter-process communication, multi-thread concurrency and so on. Need to be combined with business scenarios for selection and combination.

The very purpose of having multiple computers is to support more business. This introduces complexity in the following aspects:

  1. The complexity of task assignment requires the addition of a task dispatcher’s role. The stability of the task dispatcher, the algorithm of assignment, the choice of assignment scheme, and so on itself bring complexity

  2. Task decomposition: When the task itself is complex enough, the complex task needs to be split. The reason is that the single system is too complex, coupling is large, performance optimization is difficult to carry out, high risk. But since performance degrades after splitting, there is a balance between the number of splits and efficiency

High availability

The key to high availability is no interruption, essentially through redundancy. Because interrupts are theoretically unavoidable, redundancy is used to increase system stability.

In computing scenarios, the complexity of increasing the task dispatcher is also needed to deal with. The allocation algorithm also needs to be carefully considered, several primary and several standby.

In storage scenarios, consistency, availability, and fault tolerance of partitions cannot all be met. In order to improve fault tolerance of partitions, it is necessary to add as many nodes as possible. The more nodes there are, the more data needs to be replicated to ensure consistency, and the less guaranteed availability is.

High availability requires extra attention to the impact of data inconsistency on services.

In a high availability system based on redundancy implementation, state decisions are inherently impossible to be completely correct. If the use of authoritarian style, then the dictator’s problems can not be correctly judged; If negotiation is used, state interruptions cannot be handled correctly. In addition to the complexity of adopting democracy, it can also be problematic.

scalability

A system with good scalability requires two basic conditions: correctly predicting change and perfectly encapsulating change.

The complexity of predicting change is that scalability cannot be considered at every design point, and predictions can be wrong. And a lot of it depends on experience.

There is no definite standard for encapsulating change, change layer and stability layer. It is necessary to design the interface between change layer and stability layer and carry out reasonable abstraction, which is a very complicated thing in itself.