From novice programmers to senior technical experts in large factories, these system architecture schemes are what you must master! !

Hello everyone, I am Glacier~~

With the development of the Internet, the business of Internet companies is also developing rapidly, which in turn leads to continuous changes in the architecture of the system. Generally speaking, the architecture of the system has roughly gone through: the evolution of monolithic application architecture—>vertical application architecture—>distributed architecture—>SOA architecture—>microservice architecture. Of course, the system architecture of many Internet companies has evolved to Service Mesh. Today, we will talk about the evolution of the system architecture.

If the friends think the article is good, like, bookmark, comment, share and go together, give Glacier a one-click triple connection~~

Okay, let's get started.

Monolithic application architecture

In the early stage of enterprise development, the general company's website traffic is relatively small, and only one application is needed. All the functional codes are packaged into a service and deployed on the server to support the company's business. This can also reduce the cost of development, deployment and maintenance.

For example, the e-commerce system that everyone is familiar with mainly includes: user management, merchandise management, order management, payment management, inventory management, logistics management and other modules. In the initial stage, we will write all modules into a Web project. In, and then unified deployment to a Web server.

This architectural feature has its advantages:

  • The structure is simple, and the cost of project development and maintenance is low.
  • All project modules are deployed together, which is easy to maintain for small projects.

However, its shortcomings are also more obvious:

  • All modules are coupled together, although for small projects, maintenance is convenient. However, for large projects, it is not easy to develop and maintain.
  • The modules of the project were too coupled before. If there is a problem with one module, the entire project will be unavailable.
  • It is not possible to improve performance for a specific module.
  • The project cannot be scaled horizontally.

It is precisely because of the many shortcomings of the monolithic application architecture that it gradually evolved into a vertical application architecture. Next, let's take a look at the vertical application architecture.

Vertical application architecture

With the continuous development of enterprise business, it is found that a single node single application is not enough to support the development of the business, so the enterprise will deploy multiple copies of the single application and place them on different servers. However, you will find that not all modules will have a relatively large amount of visits at this time. If you want to optimize and improve the performance of some modules in the project, it is impossible for a single application at this time. Ever since, the vertical application architecture was born.

The vertical application architecture is to split the original project application and split it into several applications that do not want to interact with each other, so as to improve the overall performance of the system.

Here, we also take the e-commerce system as an example. Under the vertical application architecture, we can split the entire e-commerce project into: e-commerce transaction system, background management system, CMS management system, etc.

After we split the monolithic application architecture into the vertical application architecture, once the traffic volume becomes larger, we only need to add server nodes for the business with large traffic volume, instead of adding server nodes for the entire project.

The advantages of this architecture:

  • The system has been split and can be optimized in a targeted manner according to the access conditions of different systems.
  • Can realize the horizontal expansion of the application.
  • Each system can share the overall access traffic, which solves the concurrency problem.
  • If a system fails, the operating conditions of other systems are not used, which improves the overall fault tolerance rate.

Disadvantages of this architecture:

  • The separated systems are relatively independent and cannot call each other.
  • It is inevitable that there will be overlapping services in each system, and there will be repeated development services, and later maintenance is more difficult.

Distributed architecture

After we evolve the system into a vertical application architecture, when there are more and more vertical applications, more and more business codes will be written repeatedly. At this point, we need to abstract the repeated code to form a unified service for other systems or business modules to call. At this point, the system will evolve into a distributed architecture.

In a distributed architecture, we will split the system as a whole into a service layer and a presentation layer. The service layer encapsulates specific business logic for the presentation layer to call, and the presentation layer is responsible for handling the interaction with the page.

The advantages of this architecture:

  • The repetitive business code is abstracted to form a public access service, which improves the reusability of the code.
  • The performance of systems and services can be optimized to improve overall access performance.

Disadvantages of this architecture:

The degree of coupling between systems becomes higher, and the calling relationship becomes complicated and difficult to maintain.

SOA architecture

In a distributed architecture, when more and more services are deployed, there will be more and more duplicate codes, and problems such as capacity evaluation and the waste of small service resources are more serious. At this point, we need to add a unified dispatch center to manage the cluster in real time. At this point, the system will evolve into an SOA (service-oriented) architecture.

The advantages of this architecture:

Use the registry to solve the automatic registration and discovery of the service dependency and calling relationship between various services.

Disadvantages of this architecture:

Microservice architecture

With the development of the business, we further expanded on the basis of the SOA architecture and completely split it into a microservice architecture. Under the microservice architecture, we split a large project into small microservices that can be deployed independently, and each microservice has its own database.

The advantages of this architecture:

  • Services are completely split, and each service is packaged, deployed and upgraded independently.
  • The business that each microservice is responsible for is relatively clear, which is conducive to later expansion and maintenance.
  • REST and RPC protocols can be used to communicate between microservices.

Disadvantages of this architecture:

  • The cost of development is relatively high.
  • It involves the fault tolerance of each service.
  • It involves data consistency issues.
  • It involves distributed transaction issues (you can refer to the topic of [ Distributed Transaction ] that I will continue to update later ).

Write at the end

If you want to enter a big factory, want to get a promotion or raise your salary, or feel confused about your current job, you can send a private message to me to communicate. I hope some of my experience can help everyone~~

Recommended reading:

Okay, let’s stop here today, friends like, favorite, comment, one-click three in a row, I’m Glacier, we’ll see you in the next issue~~