This is the 11th day of my participation in Gwen Challenge

The development history of microservices

Monomer architecture

A single architecture, as the name implies, is a jar or war package produced by a project that covers all the functionality of an application

Using range

In the early stage of business development, the system functions are relatively primary, and the pursuit is simple, efficient, rapid iteration and on-line. At this time, monomer architecture is often used.

Clustering and vertical

What is a cluster

At this stage, all functions are still in a jar package or WAR package in the same project at the beginning, but the project will be run in multiple places at the same time, and then the reverse proxy is introduced for load balancing. Of course, they still share the same data source, and this operation mode becomes cluster

What is vertical

The application side can continuously add new JAR package (WAR package), and then through the load balancing can share the access pressure in the application, but for the change of application function is not flexible, and there will be database side pressure if the database sharing. Then we need to consider the vertical split of programs and databases (split into different databases according to different business functions) and the horizontal split of some large tables (if there is too much data for a function, divide the database into tables)

implementation

Split Service1 and Service2 from one application into two applications (printing out their respective JAR packages or WAR packages), and the database is split into DB1 (for Servic1) and DB2 (for Service2) databases based on the service

SOA

A turning point

Sometimes business function is not completely separated, each service will also directly by the associated, Service1 is customer service, for example, Service2 is a service order, then order service to generate order need to use contains the user information, and the data of the order service itself is not save user information, so you need to call customer service to provide, If many services use user services, then there is a lot of pressure on user services, how to solve it?

This is where the SOA framework comes in

The service provider registers itself in the service registry (common solutions are Zookeeper and Nacos). When the client invokes the service, it first finds the service invocation address (service provider registration is provided) according to the service name (possibly also the machine room, group, version number, etc.), and then invokes according to the service invocation address.

The service provider registers itself as a temporary Zookeeper node. After the shutdown, the temporary Zookeeper node sends messages. The client monitors the change of the temporary Zookeeper node through Watch and removes the unavailable node from the call list by sensing the change.

Finally, what is the relationship from SOA to microservices?

Microservice is the sublimation of SOA. A key point of microservice architecture is that “business needs thorough componentization and servitization”. The original single business system will be split into several small applications that can be independently developed, designed and operated. These small applications interact and integrate with each other through services.

For example (see the last picture)

True microservices architecture

Today’s summary covers the evolution of microservices, from the beginning of monomer -> cluster and vertical ->SOA(sublimation to microservices), Over!