"Introduction to Spring Cloud"

What is a microservice

微服务的概念源于2014年3月Martin Fowler所写的一篇文章“Microservices”
1. Microservice architecture is an architectural pattern that divides applications into a set of small services, and the services coordinate and cooperate with each other to provide users with ultimate value
2. Each service runs in its own process, and a lightweight communication mechanism is used between services to communicate with each other
3. Each service is built around a specific business and can be independently deployed to a production environment, a production-like environment, etc.
4. A large and complex software application consists of one or more microservices. Each microservice in the system can be deployed independently, and each microservice is loosely coupled. Each microservice only focuses on completing one task and completing that task well

Advantages of microservices

Controllable complexity

Each microservice focuses on a single function, and each microservice can be fully controlled by a small-scale development team, which is easy to maintain high maintainability and development efficiency

Standalone deployment

Since microservices have independent running processes, each microservice can also be deployed independently, reducing the risk to the production environment and ultimately shortening the application delivery cycle

Flexible technology selection

Under the microservice architecture, technology selection is decentralized, and you can freely choose the most suitable technology stack. Since each microservice is relatively simple, even a complete refactoring of a microservice is feasible

Fault tolerance

When a component fails, under the traditional architecture of a single process, the fault is likely to spread within the process, resulting in a global unavailability of the application. Under the microservice architecture, the fault will be isolated in a single service. If well-designed, other services can achieve application-level fault tolerance through mechanisms such as retries and smooth degradation.

Expand

Monolithic architecture applications can also achieve horizontal expansion, that is, the entire application is completely copied to different nodes. When the different components of the application have differences in expansion requirements, the microservice architecture reflects its flexibility, because each service can be expanded independently according to actual needs.

Spring cloud introduction

Spring cloud is a collection of a series of frameworks. It uses the development convenience of spring boot to simplify the development of distributed system infrastructure.
如服务发现注册、配置中心、消息总线、负载均衡、断路器、数据监控等, You can use the spring boot development style to achieve one-click startup and deployment,
Spring cloud does not repeat the manufacturing of wheels. It just develops the more mature ones currently developed by various companies, and uses the spring boot style to repackage and shield the complex configuration and implementation principles.

spring cloud technical composition

Insert picture description here

  • 1- eureka-microservice governance, service registration and discovery

  • 2- ribbon —— load balancing, request retry

  • 3- hystrix-circuit breaker, service degradation, fusing

  • 4- feign —— ribbon + hystrix integration, and provide declarative client

  • 5- hystrix dashboard and turbine —— hystrix data monitoring

  • 6- zuul —— API gateway, provides a unified entrance to microservices, and provides unified authorization verification

  • 7- config —— Configuration Center

  • 8- bus —— message bus, configuration refresh

  • 9- sleuth+zipkin —— link tracking


Guess you like

Origin blog.csdn.net/weixin_45103228/article/details/114030714