What is SOA (Service Oriented Architecture)?

Recently, I am learning springboot, and I have encountered springcloud again. I have also encountered any single, distributed, SOA, microservice and other architectures. In this section, let's learn what is SOA (service-oriented architecture)?

First, let's take a look at the concept of Baidu:

Baidu Concept

Service Oriented Architecture(SOA) is a component model that separates different functional units of an application (called services) and connects them through well-defined interfaces and protocols between those services. An interface is defined in a neutral way, and it should be independent of the hardware platform, operating system, and programming language that implements the service. This allows services built in a wide variety of systems to interact in a unified and common way.

Most people must not understand, let's refine the above words:

vernacular concept

SOAIt is a service-oriented architecture, based on a distributed architecture, which splits different business functions into services and connects them through well-defined interfaces and protocols between these services.

In general, SOA is not a specific technology, but an idea and an architecture for developing projects.

So how did this structure come about? Let's take a look:

The evolution of software architecture

The development of software architecture has experienced fromMonolithic Architecturevertical architectureSOA ArchitecturearriveMicroservice Architecturethe process of.

Monolithic Architecture

In the early days of web application development, most web engineers packaged all functional modules together and ran them in a web container, and all functional modules used the same database.

The following figure is an e-commerce system with a single architecture:
insert image description here

Features:

1. All functions are integrated in a project project.
2. All functions are deployed to the server in a war package.
3. Improve system performance by deploying application clusters and database clusters.

advantage:

1. The project structure is simple, the initial development cost is low, the cycle is short, and the first choice for small projects.
2. The development efficiency is high, and the interaction between modules adopts local method calls.
3. It is easy to deploy and has low operation and maintenance costs. It can be directly packaged into a complete package and copied to a certain directory of the web container to run.
4. Easy to test: IDEs are designed for the development of a single application and are easy to test - the complete system can be started locally.

shortcoming:

1. All functions are integrated in one project,Difficult to develop, expand and maintain for large projects
2、The version iteration speed gradually slows down, modifying one place requires compiling, deploying, and starting the entire application, and the development and testing cycle is too long.
3.Cannot scale on demand, achieve horizontal expansion through clustering, and cannot scale on demand for a business

Distributed Architecture

In view of the shortcomings of the single structure, in order to meet the development needs of large-scale projects, many companies vertically split a single system into several systems according to business, and the systems interact with each other to complete the user's business processing. Each system can be distributed deployment, this architecture is calledDistributed Architecture

insert image description here

Features:

1. According to the business vertical split into a single system, this architecture is also called vertical architecture.
insert image description here

2. There is data redundancy between the system and the system, and the coupling is relatively large. As shown in the above figure, all three items have customer information.
3. Most of the interfaces between systems are to achieve data synchronization. As shown in the above figure, the three items need to synchronize customer information.

advantage:

1. Through vertical splitting, each subsystem becomes a small system with simple functions, low initial development cost and short cycle.
2. Each subsystem can be scaled as needed.
3. Each subsystem can use different technologies.

shortcoming:

1、There are data redundancy, functional redundancy and high coupling between subsystems
2、On-demand scaling granularity is not enough, which cannot be implemented for different services in the same subsystem, such as order management and user management.

SOA Architecture

SOAIt is a service-oriented architecture, based on a distributed architecture, which splits different business functions into services and connects them through well-defined interfaces and protocols between these services.

insert image description here

Features:

1. Based on the architectural idea of ​​SOA, the repeated public functions are extracted into components, and services are provided to various systems in the form of services.
2. Use webservice, rpc and other methods to communicate between each system and service.
3. The ESB enterprise service bus serves as a bridge for communication between systems and services.

advantage:

1. Extract repetitive functions as services, improve development efficiency, and improve system reusability and maintainability.
2. It can be scaled on demand according to the characteristics of different services.
3. Use ESB to reduce interface coupling in the system.

shortcoming:

1、The line between systems and services is blurring, the granularity of the extracted service will be too large, and the coupling between the system and the service will be high.
2. Although ESB is used,The interface protocol of the service is not fixed and there are many kinds, which is not conducive to system maintenance

Microservice Architecture

Based on the idea of ​​SOA architecture, in order to meet the needs of mobile Internet for large-scale projects and multi-clients, the service layer is divided into fine-grained parts. Each divided service only completes a specific business function. Order-related business, user service implementation of user management-related business, etc. The granularity of the service is very small, so it is calledMicroservice Architecture

insert image description here

Features:

1. The service layer is divided into microservices one by one according to the business.
2. Microservices have a single responsibility.
3. Lightweight protocols such as RESTful and RPC are used for transmission between microservices.
4. It is beneficial to adopt the front-end and back-end separation architecture.

advantage:

1. The granularity of service splitting is finer, which is conducive to resource reuse and improves development efficiency.
2. The optimization plan for each service can be formulated more accurately and scaled as needed.
3. It is suitable for the Internet era, and the product iteration cycle is shorter.

shortcoming:

1. ==The complexity of development increases==, because a business process requires multiple microservices to interact through the network to complete.
2,Too many microservices, high cost of service governance, not conducive to system maintenance

Summarize

Do you understand something about SOA now?

SOA is a Service Oriented Architecture, based on a distributed architecture, which splits different business functions into services and connects them through well-defined interfaces and protocols between these services.

Guess you like

Origin blog.csdn.net/weixin_45525272/article/details/123552570