Introduction to the

Spring Cloud is a Cloud application development tool based on Spring Boot implementation. It provides an easy way to develop operations such as configuration management, service discovery, circuit breakers, intelligent routing, microproxy, control bus, global locking, decision campaigning, distributed session, and cluster state management in JVM-based cloud application development.

The core of servitization is to split the traditional one-stop application into one service by one service according to the business, while microservices should be more thoroughly decoupled (no more sharing DB, KV, get rid of heavyweight ESB), and emphasize DevOps and rapid evolution.

  • DevOps: Requires integration of development, testing, and operations, smaller, more frequent, more automated application releases, and infrastructure architecture around application architectures. This requires the application of sufficient cohesion, but also convenient operation and management.

Why use, advantages over, and servitization solutions (for example:Nginx)

The original servization solution was to provide a unified domain name for the same service, and then the service caller would send HTTP requests to this domain name, and Nginx would distribute and redirect the requests.

  • The service invocation logic is coupled in the configuration file, which weakens the integrity of microservices
  • Information about services is scattered across systems and cannot be managed and maintained uniformly, and service consumers do not know what instances are providing services to them.
  • The current health and communication frequency of service providers and service consumers cannot be visually seen.
  • There is no unified strategy for consumer failure repetition, load balancing, etc., which increases the difficulty of developing each service and is not conducive to rapid evolution.

Spring Cloud vs. Dubbo

Microservice function Dubbo Spring Cloud
Service registration and discovery Zookeeper Eureka,Consul
Service invocation mode RPC RESTful API
The circuit breaker There are Hystrix
Load balancing There are Ribbon,Feign(RESTful Web Service client, integrated Ribbon and Hystrix)
Service routing and filtering There are There are
Distributed configuration There is no There are
A distributed lock There is no There are
Cluster to choose the main There is no There are
Distributed message There is no There are

Spring Cloud abandons Dubbo’s RPC communication in favor of an HTTP-based REST approach. Strictly speaking, both approaches have their pros and cons. While the latter compromises the performance of service invocations to some extent, it also avoids the problems of native RPC mentioned above. In addition, REST is more flexible than RPC. The dependence of service providers and callers only depends on a contract, and there is no strong dependence at the code level, which is more appropriate in the microservice environment that emphasizes rapid evolution.

conclusion

There is a full deployment of Spring Cloud on Github. Other related articles Spring Cloud (1)- Introduction and options Spring Cloud (2)- Service Discovery (Eureka, Consul) Spring Cloud (3)- Load Balancing (Feign, Ribbon Spring Cloud (4)- Hystrix Spring Cloud (5)- Zuul Spring Cloud (6)- Configuration Management and Refresh (Config, Bus) Give a star ~ personal blog ~ Jane book ~