[Microservice Architecture] Introduction to SpringCloud Components and Concepts (1)

One: What is Microservice (Microservice)

 

 The English name of microservice is Microservice, and the Microservice architecture pattern is to organize the entire web application into a series of small web services. These small web services can be compiled and deployed independently, and communicate with each other through their respective exposed API interfaces. They work with each other to provide functionality to users as a whole, but can be extended independently.

 

  Functions or usage scenarios required by the microservice architecture

        1: We split the entire system into several subsystems according to the business.

 2: Each subsystem can deploy multiple applications, and use load balancing among multiple applications.

 3: A service registry is required, all services are registered in the registry, and load balancing is also achieved through the use of certain policies by the services registered in the registry.

 4: All clients access the background services through the same gateway address. Through routing configuration, the gateway determines which service a URL request is processed by. Load balancing is also used when forwarding requests to services.

 5: Sometimes services also need to access each other. For example, there is a user module, when other services process some services, they need to obtain user data of the user service.

 6: A circuit breaker is needed to deal with timeouts and errors in service calls in a timely manner to prevent the paralysis of the overall system due to a problem with one of the services.

 7: A monitoring function is also required to monitor the time spent in each service call, etc.

  

  The current mainstream microservice frameworks: Dubbo, SpringCloud, thrift, Hessian, etc. At present, most of the domestic small and medium-sized enterprises use Dubbo, and SpringCloud is estimated to be rare, and some developers may not have heard of it.

  

Two: Introduction to the SpringCloud project

 

   springCloud is a set of frameworks for implementing microservices based on SpringBoot. It provides components such as configuration management, service discovery, circuit breakers, intelligent routing, micro-agents, control buses, global locks, decision campaigns, distributed sessions, and cluster state management required for microservice development. the most important is,

  Using it with the spring boot framework will make it very convenient for you to develop cloud services with a microservice architecture.

  

  SpringBoot is designed to simplify the creation of production-level Spring applications and services, simplify configuration files, use an embedded web server, and include many out-of-the-box microservice features

  

  Related component architecture diagram

  

  Spring cloud subprojects include:

 

  Spring Cloud Config: A configuration management development kit that allows you to put configuration on a remote server, currently supports local storage, Git and Subversion.

 

 

  Spring Cloud Bus: Event, message bus for propagating state changes in the cluster (for example, configuration change events), can be combined with Spring Cloud Config for hot deployment.

 

  Spring Cloud Netflix: SDKs for various Netflix components, including Eureka, Hystrix, Zuul, Archaius, and more.

 

  Netflix Eureka: Cloud Load Balancing, a REST-based service for locating services for load balancing in the cloud and failover of middle-tier servers.

 

  Netflix Hystrix: A fault tolerance management tool designed to provide greater fault tolerance to latency and failures by controlling nodes for services and third-party libraries.

 

  Netflix Zuul: Edge service tool, is an edge service that provides dynamic routing, monitoring, resiliency, security, and more.

 

  Netflix Archaius: Configuration management API, including a series of configuration management APIs, providing functions such as dynamically typed properties, thread-safe configuration operations, polling framework, and callback mechanisms.

 

  Spring Cloud for Cloud Foundry: Bind services to CloudFoundry through the Oauth2 protocol. CloudFoundry is an open source PaaS cloud platform launched by VMware.

 

  Spring Cloud Sleuth: A log collection toolkit that encapsulates Dapper, Zipkin and HTrace operations.

 

  Spring Cloud Data Flow: Big data manipulation tool that manipulates data flow through the command line.

 

  Spring Cloud Security: A security toolkit to add security controls to your application, mainly referring to OAuth2.

 

  Spring Cloud Consul: Encapsulates Consul operations. Consul is a service discovery and configuration tool that can be seamlessly integrated with Docker containers.

 

  Spring Cloud Zookeeper: A toolkit for operating Zookeeper for service registration and discovery using the zookeeper method.

 

  Spring Cloud Stream: Data stream operation development kit, which encapsulates sending and receiving messages with Redis, Rabbit, Kafka, etc.

 

  Spring Cloud CLI: Based on the Spring Boot CLI, it allows you to quickly build cloud components from the command line.

  

  SpringCloud Features

       1: Convention over configuration

2: Out of the box, quick start

3: Suitable for various environments

4: Lightweight Components

5: Rich component support and complete functions

  

Three: SpringBoot understands

 

    Spring Boot makes our Spring applications lighter. For example: you can just rely on a Java class to run a Spring reference. You can also package your application as a jar and run your Spring web application by using java -jar.

Since SpringCloud relies on SpringBoot, you need to understand SpringBoot before learning the SpringCloud framework.

The main advantages of SpringBoot:

  1: Faster onboarding for all Spring developers

  2: Out of the box, various default configurations are provided to simplify project configuration

  3: Embedded Containers Simplify Web Projects

  4: No redundant code generation and XML configuration requirements

  

Learn about the address through a helloWorld: http://start.spring.io/

 

       This article mainly introduces the actual operation and application of related concepts, which will be introduced slowly in the following articles.

 

 

 

Related information: Chinese website: https://springcloud.cc/

                  English official network: https://spring.io/projects

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326394455&siteId=291194637