Difference Between Microservices and SOA

Conclusion: Microservice is a product developed by SOA, which is a relatively modern, fine-grained SOA implementation.

MSA vs SOA


1. ESB (enterprise service bus)
       can be known from the name. Its concept draws on the communication model in the principle of computer composition - bus. All systems that need to communicate with external systems are all connected to ESB. Isn't it perfectly compatible? Existing heterogeneous systems that are isolated from each other can be used to build a brand-new loosely coupled heterogeneous distributed system.

      However, in actual use, it still has many shortcomings. First, the ESB itself is very complicated, which greatly increases the complexity and maintainability of the system. The second is that because the ESB wants to communicate all services through a channel, the communication speed is directly reduced.

      In modern microservices, using a lightweight communication mechanism, each service has its own processing logic, it knows where the service it is looking for, and does not need to do anything on the communication link.

2. The concept of service and the size
      of service SOA actually appeared to solve historical problems: in the process of informatization, enterprises will have various systems that are isolated from each other, and there needs to be a mechanism to integrate them. There is the emergence of the ESB described above. Similarly, it also resulted in a big concept of services in the early days of SOA, usually specifying a system that can operate independently (in this way, it seems that the services are naturally loosely coupled). This approach is equivalent to "serving the subsystem".
      Microservices, on the other hand, have no historical burden and are light-loaded. The size of services is usually not too large. Regarding the size of services, in actual situations, a service should be able to represent "an indivisible or difficult-to-divide business entity in an actual business scenario." ". Keeping the size of the service to a smaller volume can bring many benefits.


3. Communication protocol
      Nowadays, more and more projects begin to use RESTful as the basis for API design, but only a few years ago, there were still a lot of APIs using SOAP, WSDL and other heavyweight XML-based Web services. This point is actually similar to the two points mentioned above. If you think about it carefully, they are all caused by historical reasons. Similarly, after the development of communication protocols over the years, there are basically two mainstream ones:

          The most widely used text protocol is the HTTP-based RESTful specification
           lightweight binary protocol Thrift, Protobuf, or any custom lightweight protocol

 

Advantages of MSA
1. The service granularity is relatively small, the implementation is simple, and it is easier to achieve low coupling and high cohesion
2. Distributed deployment, independent maintenance
3. When the pressure of a service is high, instances can be added to achieve horizontal expansion
4. Easier to focus on actual business scenarios

Guess you like

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