Keep in mind that

  1. There is no best architecture, only the most suitable architecture
  2. Good architecture is not designed, it is evolved

Every architect, when doing architectural design, more or less has his own architectural design principles. Here are some of the architectural design principles that have guided me in the past that I hope will prove useful to you.

1. N+1 design

Every component in the system should be free of single points of failure

2. Roll back design

Ensure that the system is forward compatible and there should be a way to roll back versions when the system is upgraded

3. Disable design

A configuration should be provided to control the availability of specific functions and to quickly bring them offline in the event of a system failure

4. Monitoring design

Monitoring means should be considered in the design stage

5. Design of multi-active data center

If the system needs high availability, you should consider implementing multiple data centers in multiple locations so that the system can still be used when at least one machine room is powered off

6. Adopt mature technology

New or open source technologies often have many hidden bugs, and failure without commercial support can be a disaster

7. Resource isolation design

Avoid a single service taking up all resources

8. The architecture should scale horizontally

Only when the system can be extended horizontally can bottleneck problems be avoided effectively

9, non-core to buy

If non-core functions require a lot of R&D resources to solve, consider buying mature products

10. Use commercial hardware

Commercial hardware can effectively reduce the probability of hardware failure

11. Iterate quickly

The system should develop small functional modules quickly and go online for verification as soon as possible, so that problems can be found early to greatly reduce the risk of system delivery

Stateless design

The service interface should be stateless, with access to the current interface independent of the state of the interface’s last access

SOLID Principles (Six design principles of class)

In design patterns, there are six principles, referred to as SOLID Principles:

  1. 1. The Principle of Single Responsibility
  2. Open Closed Principle: The Open Closed Principle
  3. Substitution Principle: Liskov Substitution Principle
  4. The Law of Demeter
  5. Interface Segregation Principle: Interface Segregation Principle
  6. Dependence Inversion Principle

“Build architecture with abstractions and expand details with implementations.”

Because abstraction has good flexibility and wide adaptability, as long as the abstraction is reasonable, it can basically ensure the stability of the architecture. However, in software, we use implementation classes derived from abstraction to extend the changeable details. When the software needs to change, we just need to derive an implementation class to extend according to the requirements. Of course, the premise is that the abstraction should be reasonable, and that the requirements should be forward-looking and predictable.

  • The single responsibility principle: It guides us to implement a class with a single responsibility;
  • On/Off principle: instructs us to close for extension development and for modification;
  • Richter’s substitution principle: instructs us not to destroy inheritance;
  • Demeter’s Law: Instructs us to reduce coupling;
  • Interface isolation principle: Guide us to simplify and simplify interface design;
  • Dependency inversion principle: guide us to interface oriented programming;

If you connect the first letters of these six principles, you have the principle of SOLID.

The purpose: To use these six principles to create stable, flexible, and robust designs

For design patterns, here is a book recommended: Zen of Design Patterns, from Qin Xiaobo. I got it right after it was published, and I read it a few times. It had a big impact on me. Each usage is very detailed, technical personnel side one of the books, recommended to read

other

  • [Architecture] Principles of high availability and high concurrency system design
  • Server – High concurrency and high availability design principles/distributed architecture evolution process

additional

  • The evolution of architecture in 2019 (System Architect) – from information flow architecture to e-commerce platform architecture
  • E-commerce platform composition download
  • Do you really know the middle station?


My CSDN home page

About me (Personal domain name, more information about me)

Github, my open source project collection

I look forward to learning and growing together with you. Thank you

Welcome to exchange questions, you can add personal QQ 469580884,

Or, add my group number 751925591 to discuss communication issues

Do not speak empty, only doer

Talk is cheap, show me the code