Brief introduction of Springcloud micro-service (I.)

Source: Internet
Author: User
Tags failover zookeeper

A simple understanding of Spring cloud

MicroServices English Name Microservice,microservice schema mode 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 exposed API interfaces. They work together to provide functionality to the user as a whole, but can be expanded independently.

Features or usage scenarios required by the MicroServices architecture

1: We divide the whole system into several subsystems according to the business.

2: Each subsystem can deploy multiple applications, using load balancing across multiple applications.

3: A service registry is required, all services are registered in the registry, and load balancing is achieved by using a certain policy through the services registered in the registry.

4: All clients access the backend service through the same gateway address, through the routing configuration, the gateway to determine which service a URL request is handled by. Load balancing is also used when the request is forwarded to the service.

5: Services sometimes require mutual access. For example, there is a user module, the other services in the processing of some business, to obtain user data of customer service.

6: A circuit breaker is required to handle time-outs and errors in service invocation, preventing the overall system from being paralysed due to one of the service's problems.

7: A monitoring function is also required to monitor the time spent on each service invocation.

The current mainstream micro-service framework: Dubbo, Springcloud, Thrift, Hessian, and so on, most of the domestic small and medium-sized enterprises are Dubbo,springcloud estimates are very few, perhaps some development students have not heard of.

Springcloud is a springboot-based framework for implementing microservices. He provides components such as configuration management, service discovery, circuit breakers, intelligent routing, micro-proxies, control buses, global locks, decision-making campaigns, distributed sessions, and cluster state management required for micro-service development. The most important thing is that

Working with the Spring boot framework will make it very convenient for you to develop a cloud service for your microservices architecture.

Springboot is designed to streamline the creation of product-level Spring applications and services, simplifies configuration files, uses embedded Web servers, and includes many out-of-the-box microservices capabilities

Related Component architecture diagram

Spring Cloud is a spring boot-based cloud application development tool for configuration management, service discovery, circuit breakers, intelligent routing, micro-agents, control buses, global locks, decision-making campaigns, Operations such as distributed sessions and cluster state management provide a simple way to develop.

Spring Cloud contains multiple sub-projects (for many different open source products involved in distributed systems), such as spring Cloud Config, Spring Cloud Netflix, Spring Cloud Cloudfoundry, Spring Cloud AWS, Spring Cloud Security, Spring Cloud Commons, Spring Cloud Zookeeper, Spring Cloud CLI, and more.

Related Component architecture diagram

Spring Cloud sub-projects include:

Spring Cloud Config: The Configuration Management Development Kit lets you put your configuration on a remote server that currently supports local storage, git, and subversion.

Spring Cloud Bus: event, message bus, used to propagate state changes in a cluster (for example, configuration change events), which can be combined with Spring Cloud Config for hot deployment.

Spring Cloud Netflix: Development kits for a variety of Netflix components, including Eureka, Hystrix, Zuul, Archaius, and more.

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

Netflix hystrix: Fault-tolerant management tools designed to provide greater fault tolerance for latency and failures by controlling the nodes of services and third-party libraries.

Netflix Zuul: Edge Service tool that provides dynamic routing, monitoring, resiliency, security and other edge services.

Netflix Archaius: The Configuration Management API, which includes a series of configuration management APIs that provide dynamic typed properties, thread-safe configuration operations, polling frameworks, callback mechanisms, and more.

Spring Cloud for Cloud Foundry: The OAUTH2 Protocol binding service to Cloudfoundry,cloudfoundry is the open source PAAs cloud platform that VMware has launched.

Spring Cloud Sleuth: A Log collection toolkit that encapsulates Dapper,zipkin and htrace operations.

Spring Cloud Data Flow: The Big data manipulation tool that operates data streams from the command line.

Spring Cloud Security: Safety Toolkit, which adds security controls to your application, mainly refers to OAuth2.

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

Spring Cloud Zookeeper: A toolkit for manipulating Zookeeper for service registration and discovery using Zookeeper methods.

Spring Cloud Stream: A data flow Operation development package that encapsulates a send receive message with Redis,rabbit, Kafka, and so on.

Spring Cloud CLI: Based on the spring Boot CLI, allows you to quickly build cloud components in a command-line manner.

Springcloud Features

1: Convention is better than configuration

2: Off-the-box, quick Start

3: Suitable for various environments

4: Lightweight Components

5: Rich component support, full function

Springcloud Service Discovery (Eureka) Introduction

Eureka is a service discovery framework developed by Netflix, Springcloud integrates it into its own subproject Spring-cloud-netflix, enabling Springcloud service discovery capabilities.
Why use Eureka, because in a complete system architecture, any single point of service can not guarantee uninterrupted, so we need service discovery mechanism, after a node outage, other nodes can continue to provide services, so that the entire system is highly available.
There are two modes of service discovery: The client discovery mode and the service-side discovery mode. The Erueka uses the client discovery mode.

Schema found by client service

Eureka Server provides service registration services, and after each service node is started, it is registered in Eureka server so that Eureka server has all the service node information and Eureka a monitoring page. You can visually see all registered services in the page. At the same time Eureka has a heartbeat mechanism, when a node service does not send a heartbeat signal within the specified time, Eureka will remove the service node from the service registry. Eureka also provides a mechanism for client caching, and even if all Eureka servers are hung up, the client can still invoke the Service node's service with the information in the cache. Eureka is typically used in conjunction with the Ribbon, which provides client load balancing, and the Ribbon leverages the service information read from the Eureka to perform a reasonable load when invoking services provided by the service node.
Eureka provides high availability and flexibility through the mechanisms of heartbeat detection, health check, and client-side caching.

Eureka is a sub-module of spring Cloud Netflix and one of the core modules. For cloud service discovery, a rest-based service for locating services to enable mid-tier service discovery and failover in the cloud.

Service registration and discovery is very important for microservices systems. With the service discovery and registration, you do not need to change the service call configuration file all day, you just need to use the service identifier, you can access to the service. His function is similar to Dubbo's registry.

Service discovery: Service discovery is one of the key principles of microservices infrastructure. Attempting to configure a contract for each client or a format can be said to be very difficult and very fragile. Eureka is a service and client discovered by the Netflix service. This service can be configured and deployed with high availability, and the status of each service can be replicated to each other within the registered service.

Service registration: When a client registers to Eureka, it provides metadata about itself (such as host and port, health metrics URL, home page, etc.) Eureka receives heartbeat information from each instance through a service. If the heartbeat fails to receive more than the configured time, the instance will normally be removed from the registration

is the basic service registration and discovery

Brief introduction of Springcloud micro-service (I.)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.