Scenes
If we open the Alipay homepage and look at our balance, it will display your total assets, yesterday’s earnings, accumulated earnings and other information. If the information displayed on this page comes from various systems/applications, we display these data through various interfaces. If we want to display these few data on the front-end page, how should we display it?
In this case, it is impossible for the client to communicate with 6 different applications/systems to complete the data display. Instead, the six applications/systems communicate with each other to complete the call. Finally, the client only needs to call an interface to obtain data, instead of communicating with each application/system. Our architecture may look like the following:
For an e-commerce system, such as Taobao, we will display a lot of data information on the homepage, such as homepage information, product information, personal information, push information, and so on. If the data displayed on the homepage comes from 100 different applications/systems, then through the above architecture, we will have hundreds or even thousands of communication interactions on the backend, and the backend structure will become very large and complex. . So under such an architecture, we need to make some adjustments to the above structure, so we introduced the SOA architecture
Diagram difference
What is SOA architecture
SOA (full name: Service Oriented Architecture), Chinese means "service-oriented architecture", you can understand it as an architectural model or a design method, rather than a service solution. It contains multiple services, and the services communicate with each other through mutual dependence or through communication mechanisms, and ultimately provide a series of functions. A service usually exists in an independent form with the operating system process. The various services are called through the network.
Compared with SOA, there is also an ESB (Enterprise Service Bus). Simply put, an ESB is a pipe that connects various service nodes. In order to integrate services of different systems and different protocols, ESB can be simply understood as: it does the conversion, interpretation and routing of messages, so that different services are interconnected;
We remove all the communication between each application, introduce an ESB enterprise bus in the middle, between each service, only need to communicate with the ESB, at this time, the interaction between each application will become clearer, business The architecture/logic, etc., will also become very clear. The originally messy and unplanned system was sorted into a planned and manageable system. In this process, the biggest change was the introduction of the ESB enterprise bus.
The core problem solved by SOA
1. system integration : From the perspective of the system, solve the communication problem between enterprise systems, and organize the network structure of the originally scattered and unplanned systems into a regular and manageable star structure between systems. This step It is often necessary to introduce some products, such as ESB, technical specifications, and service management specifications; the core problem to be solved in this step is [orderly]
2. system : From a functional point of view, the business logic is abstracted into reusable and assembleable services, and rapid business regeneration is achieved through service orchestration. Purpose: Transform the original inherent business functions into general business services and realize the rapid reuse of business logic; the core problem to be solved in this step is [reuse]
3. Service-oriented business : From the perspective of the enterprise, abstract corporate functions into reusable and assembleable services; transform the original functional enterprise structure into a service-oriented enterprise structure, and further enhance the company’s external services Capability: The first two steps are to solve the problem of system call and system function reuse from the technical level. The third step is to encapsulate a business unit into a service based on business drive. The core problem solved in this step is [efficient]
Microservice architecture
The microservice architecture is actually similar to the SOA architecture, and the microservice is a sublimation of SOA. architecture emphasizes that "business needs to be completely componentized and servicing ". The original single business system will be split into multiple small applications that can be independently developed, designed, and run. Between such small applications and other applications, they cooperate and communicate with each other to complete an interaction and integration. This is the microservice architecture.
Componentization: A component represents a unit that can be replaced and upgraded independently. Take a PC as an example. The CPU, memory, graphics card, and hard disk in the PC are the same. They can be replaced and upgraded independently without affecting other units. If we take the PC as a component and build it as a service, then this PC only needs to maintain the motherboard and some necessary external equipment. The CPU, memory, and hard disk all provide services in the form of components. The PC needs to call the CPU for calculation processing, and only needs to know the address of the CPU component.
Characteristics of microservices
- 1. Realize componentization through services
- 2. Divide service and development teams according to business capabilities
- 3. Decentralization
- 4. Infrastructure automation (devops, automated deployment)
The difference between SOA and microservice architecture
1. Decentralization of microservices, removing the ESB enterprise bus. Microservices no longer emphasize the heavy ESB enterprise service bus in the traditional SOA architecture. At the same time, the SOA idea enters into a single business system to achieve true componentization.
2. The emergence of Docker container technology provides more convenient conditions for microservices, such as smaller deployment units, and each service can run in its own process through technologies such as Node or Spring Boot.
3. SOA focuses on system integration, while microservices focus on complete separation
Author: The Boy Carrying Sack
Link: blog.csdn.net/lzb348110175/article/details/96738781
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。