Micro Services and Springcloud introduction

    

1. What is a micro service?

  System consisting of distributed services, mainly to the decoupling of the project, splitting the functionality into discrete individual services among traditional (for example: SSM, SSH) is not flexible, long time to build, any small modifications have to reconstruct the entire project a small project may lead to hang the entire project, so there is a micro-services, we can put the entire system based on business split into multiple subsystems, each can deploy multiple applications, multiple applications using load balancing.

II. Micro-services architecture needs or usage scenarios

  1. The entire project into multiple sub operations.

  2. Each subproject can deploy multiple applications, you can load balance between multiple applications.

     3. Need a service registry (eureka) All services are registered in the registry, load balancing (Ribbon) is to use a certain strategy by registering at the registration center services to achieve.

  4. All of the clients through the service (ZUUl) address to access the background with a gateway by routing configuration, the gateway to determine which service has a URL request processing. Request is forwarded to the service, it also uses load balancing.

  5. service between sometimes need access to each other, for example, a user module, other services to deal with some business when customer service to get user data

  6. The need for a circuit breaker, the timely processing of timeouts and errors when service calls, problems which prevent a service that would bring down the entire system.

  7. Also need a monitoring function, monitor time spent in each service call

The current mainstream micro-services framework: Dubbo, SpringCloud, thrift, Hessian, etc.

II. Advantages of micro-services architecture

  1. easy to develop and maintain a micro-focus on one business service, business clarity, less code

    2. single micro-services less code, quick start

    3. Local modify easy to deploy

    4. The technology is not limited

III. The challenge micro-services

  1. Yungao maintenance requirements

  2. Using the enormous challenges of distributed systems, fault tolerance, network latency, distributed transactions, etc.

  3. Interface high call costs, communication via the interface, if you modify a micro API services, may use all of the interface between the micro-micro services will need to adapt services

  4. Many service may use the same function, leading to duplication of code

Micro service overall architecture diagram

 

 

 Four .springcloud Introduction

  1.springcloud is based on micro-services framework springboot development, it is more complete solution to the current micro-services framework, its contents include: service registration (eureka), service calls (feign), load balancing (Ribbon), circuit breaker (Hystrix )Wait

  springcloud comprising a plurality of components:

    springcloud config: Distributed Configuration Center

    springcloud netfix: form the core

       ureka: service registry

         Ribbon: client load balancing

      Feign: service call set up

      Hystrix: service framework for the protection (fuse)

      Zuul: Gateway set up to provide intelligent routing, access filtering,

 

 

Guess you like

Origin www.cnblogs.com/yangxiaoli/p/12626478.html