How to understand microservices

Before talking about microservices, we need to understand two concepts: SOA and ESB.

SOA

Service-Oriented Architecture (SOA) is a component model that links different functional units of an application (called services) through well-defined interfaces and contracts 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.

This is the explanation given in Baidu Encyclopedia. Simply put, SOA can be understood as the integration of various systems within an enterprise, each system provides external coarse-grained services, and these services are deployed on a central platform, which is ESB (Enterprise Service Bus)—Enterprise Service Bus.

This is our understanding of SOA. It is not difficult to see that ESB is a very important mechanism. First of all, it integrates a variety of heterogeneous systems, which makes the internal communication methods complicated and there are many protocols. Secondly, the high degree of centralization of ESB brings certain hidden dangers of single point of failure to enterprises, and the unified deployment of services on ESB also limits the later expansion of services to a certain extent. Based on these shortcomings, microservices came into being.

In the microservice architecture, the first key point to be emphasized is that the business system of the enterprise must be completely componentized, modularized, and service-oriented. First of all, the overall business should be divided into small businesses that can be independently designed, developed and run. The independence here refers to the independence from the business layer, application layer, data layer, and physical layer. This is the idea of ​​decentralized management of microservices. Another key point is that each independent service communicates with HTTP-type API through lightweight devices, which solves the difficulty of complex internal communication, numerous protocols and difficult invocation under the ESB mechanism in the traditional SOA architecture. In fact, for microservices, the interface capability provided by each independent business is actually the service provided by the business. The service and the business are deployed together, and the service is published and exposed through the existing interface capability.

After talking about the concept of microservices, let us finally talk about the advantages and disadvantages of microservices and the benefits it can bring to enterprises.

First of all, the advantage of microservices is obvious - independence. Under the microservice architecture, each service is independent and can be independently developed by different teams, so that the development team can focus on this business function, improve development efficiency, and because of its independence, each service can be applied differently language and development environment for development. Moreover, the microservice architecture is not completely independent. It emphasizes that each service is loosely coupled, and the services communicate through lightweight interfaces. While they exist independently, they also ensure the coupling between services. While completing the functions of the traditional SOA architecture, it solves the difficulties in the SOA architecture to a large extent.

There are advantages and disadvantages. For the microservice architecture, the first disadvantage is that different teams need to resolve communication conflicts. With more teams, communication becomes more important, and many experts even believe that the realization of microservices requires the simultaneous advancement of DevOps. The second is the technical difficulty. After it is divided into independent business modules, the interface design for communication between services becomes particularly important. The last is the deployment of the microservice architecture. How to deploy the system under the microservice architecture to the server scientifically and reasonably, while ensuring the efficient operation of each service, and reducing the cost as much as possible, is the key point for enterprises adopting the microservice architecture to consider. .

Finally, I recommend a project management tool designed and developed with a micro-service architecture - Huawei Software Development Cloud . This is a tool that covers the whole life cycle management of software development. It provides software development cloud services for developers, which can be used immediately. Project management, configuration management, code inspection, pipeline, compilation, build, deployment, testing, release, etc. can be performed in the cloud anytime, anywhere, allowing developers to quickly and easily start the journey of cloud development.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326273024&siteId=291194637