[Learn microservices from scratch] 03. The evolution process of software architecture

Hello everyone, welcome to Wanmao Academy, learn with me, and you can also become a microservice expert .

At present, most enterprise systems and Internet applications provide service capabilities in the form of the Web. According to the system organization and deployment structure, we usually divide the evolution process of the software architecture into the following stages:

  • monolithic architecture
  • vertical architecture
  • SOA architecture
  • microservice architecture

monolithic architecture

The monolithic architecture is also called the monolithic architecture , just like a monolith, all the codes, all the logic, and all the modules of the system are concentrated in one project and will be deployed in one process. For example, the following e-commerce system:

Although the e-commerce system is divided into presentation layer, business logic layer, and data access layer, they are still in the same project. For example, in the business logic layer, the logic of commodity management, inventory management, order management and other modules are all together. It is inevitable that there will be places where the codes are coupled with each other. There is me in you, and you in me. This has caused difficulties in code maintenance. For example, when modifying the product management code, the logic of inventory management will be affected if you do not pay attention, causing bugs and even accidents in the production environment.

advantage

  • Simple structure, all modules are concentrated in one project.
  • Deployment is simple, only one process needs to be deployed.

shortcoming

  • The iteration of the version is slow, and the module coupling degree is high, which will lead to the whole body.
  • Code maintenance is difficult, all modules are in one project, and there is a high risk of being mistakenly modified by others.

vertical architecture

With the development of business, the system of single architecture will become more and more bloated, and the code will become more and more difficult to maintain, so the system is vertically divided into subsystems of multiple projects, forming a vertical architecture, also known as Shaft architecture, or chimney architecture. For example, the following e-commerce system:

The original e-commerce system is divided into three independent subsystems: the order system, the logistics system, and the user system. The subsystems are independent of each other and will not affect each other. The iteration of new businesses is more efficient
. However, because the systems cannot call each other, some module functions are implemented in different systems. For example, the product management module has repeated implementations in both the order system and the logistics system.

advantage

  • The systems are independent of each other and do not affect each other.
  • New business iterations are more efficient.

shortcoming

  • There is a situation of repeated development of module functions among various systems
  • Each system is independent of each other and cannot call each other, forming an "island of information".

SOA architecture

The full name of SOA is Service Oriented Architecture, which is a service-oriented architecture . When there are more and more vertical applications, there will be more and more duplicate business codes. At this point, the repeated code can be extracted to form a unified business layer as an independent service.

SOA was proposed under the background of repeated construction and low efficiency of internal IT systems in the enterprise. The original idea was to better utilize the capabilities of various IT systems within the enterprise, solve problems such as information islands, adapt to heterogeneous systems, and integrate business functions. . For example, the following e-commerce system:

Functional modules such as order system and logistics system are defined as independent services, and all services are connected to each other through an enterprise service bus (ESB). Enterprise Service Bus (ESB) undertakes functions such as transmission protocol conversion, data format conversion, service routing, monitoring and alarming.

advantage

  • It solves the problem of isolated information islands and adapts to various heterogeneous systems.
  • Improve the reusability and maintainability of the whole system.

shortcoming

  • The interface protocol of the service is not fixed and there are many kinds, which increases the complexity.
  • Service dependencies make deployment complex.

microservice

From a certain point of view, the microservice architecture is also a service-oriented architecture. Microservices and SOA architecture look very similar, and many concepts are similar, but there are great differences in essence.

SOA architecture usually has a huge and complex ESB bus, and the ESB is used to exchange data between individual applications, and the ESB also undertakes a lot of business logic conversion and processing work; but in the concept of microservices, there is no ESB, some It's just a lightweight message communication mechanism.

Microservices is an architectural style for building large-scale, complex systems through the composition of finer-grained services organized around business capabilities and a set of design criteria rather than specific technical criteria.

Summarize

  • Monolithic architecture, all code, all logic, and all modules are concentrated in one project.
  • Vertical architecture, which divides the system vertically into subsystems of multiple projects.
  • In the SOA architecture, all services are connected to each other through the enterprise service bus (ESB).
  • The microservice architecture builds large-scale complex systems through finer-grained service combinations.

Finally, thank you for being so handsome and giving me a thumbs up .


"Learning Microservices from Scratch" General Catalog

Guess you like

Origin blog.csdn.net/heihaozi/article/details/127898901