Spring Cloud is a microservices governance framework that takes into account almost all aspects of microservices governance. I have written several articles about Spring Cloud before, focusing on the use of components. This post will answer two questions: What does Spring Cloud do in microservices architecture? How do these features provided by Spring Cloud facilitate the architecture of microservices?

History of Traditional Architecture

Monomer architecture

Single architecture is common in small and micro enterprises. A typical example is that one application, one database and one Web container can run. For example, the cloud collection of open source software developed by us is the standard single architecture.

In two cases, a single architecture may be selected. First, in the early stage of enterprise development, it is relatively simple and flexible to adopt such a scheme in order to ensure rapid online; The other is the business with higher verticality and less access pressure in traditional enterprises. In this mode, the technical requirements are low, convenient for developers at all levels to take over, but also to meet customer needs.

Here is an architecture diagram of a single architecture:

In the single architecture, the technology selection is very flexible, priority to meet the requirements of quick online, but also easy to quickly follow up the market.

Vertical architecture

After the development of the single structure for a period of time, the business model of the company has been recognized, and the transaction volume has gradually increased. At this time, some enterprises will split the original business, such as background system, front-end system and transaction system, in order to cope with greater traffic.

In this stage, the system is often divided into different levels, each level has corresponding responsibilities, UI layer is responsible for interaction with users, business logic layer is responsible for specific business functions, database layer is responsible for data exchange and storage with the upper layer.

The following is an architecture diagram of the vertical architecture:

At this stage, SSH (Struts + Spring + Hibernate) is the key technology of the project. Struts is responsible for web layer logic control, Spring is responsible for business layer management Bean, Hibernate is responsible for database operation encapsulation and persistent data.

Service-oriented architecture

As companies get bigger, there will be more and more vertical subsystems, and the call relationships between systems will increase exponentially. In this context, many companies are considering soa-based services. SOA stands for service-oriented architecture, which divides applications into modules with different responsibilities, and the different modules interact directly through specific protocols and interfaces. In this way, the whole system is divided into many individual component services to complete the request. When the traffic is too large, the corresponding components are supported by horizontal expansion. All the components interact to meet the overall business requirements.

The advantage of SOA servitization is that loosely coupled coarse-grained application components can be distributed, combined, and used over a network as required. The service layer is the foundation of SOA and can be invoked directly by applications to effectively control the artificial dependencies in the system that interact with software agents.

Servitization architecture is a set of loosely coupled architecture. The principle of service separation is high cohesion within services and low coupling between services.

Here is the servitization architecture diagram:

WebService or Dubbo can be used for service governance at this stage. The difference between SOA and microservices In fact, service-oriented architectures can already solve the needs of most enterprises, so why do we study microservices? Let’s talk about the differences; Microservice architecture emphasizes that business system needs to be thoroughly componentized and servitized. A component is a product that can provide services independently. Microservice emphasizes that every microservice has its own independent running space, including database resources, rather than ESB enterprise service bus, which is more important in traditional SOA architecture. The micro-service architecture itself is derived from the Idea of the Internet, so the services released by components emphasize the use of HTTP Rest API to carry out micro-service segmentation with smaller granularity. Conclusion: Micro-service architecture is an extension of SOA architecture, which emphasizes the independence of individual services and has smaller granularity.

Spring Cloud comes from Spring, and its quality, stability and continuity can be guaranteed. Spirng Cloud naturally supports Spring Boot, which is more convenient for business landing. The development of Spring Cloud is very fast. The related component version was 1.x when I started to contact with Spring Cloud in 2016, and now the 2. X series Spring Cloud is the most suitable framework for micro services in the Java field. Compared to other frameworks,Spring Cloud has the most support for the microservices surrounding environment. For small and medium-sized enterprises, the use of low threshold. Spring Cloud is the best implementation of microservices architecture

The following are the core features of Spring Cloud: Distributed/versioning configuration services registration and discovery routing services and calls between services Load balancing circuit breakers Distributed messaging These features are performed by different components and play an important role in the evolution of the architecture. Let’s take a look. Source: source minglisoft. Cn/honghu/tech…