Summary and analysis of microservices and Spring Cloud related components

​ Microservices are becoming more and more popular. Alibaba will take microservices as the core during Double Eleven 2019, and has accepted the baptism of the Chinese Chop Party. But when it comes to micro-characters, it reflects that there are many components, and there may be a basic version of Spring Cloud for components with the same function. Other major manufacturers may have made a series of optimizations and modifications on the basis of the correlation, resulting in many different versions, and at the same time, the functions of different components overlap, which brings many choices to the design and construction of the system architecture (all want~) .

​ Most of the components of the Spring Cloud ecosystem were maintained by Netflix. Later, due to the uneven distribution of the spoils, many of them were in a state of stopping updating. As a rising star, Spring Cloud Alibaba assumes the responsibility of component maintenance in the microservice ecosystem. Microservices and cloud-native applications are becoming more and more widespread. Without mature community maintenance, it will not be able to meet new needs and solve previous deficiencies.

​ Spring Cloud is committed to providing a one-stop solution for microservices. The purpose of this article is to sort out the concepts of related components, sort out their advantages and disadvantages and applicable scenarios.

1. Two ecology

Spring Cloud Netflix

  • Spring Cloud Netflix : As a core component provided by Netflix, it can integrate multiple Netflix OSS open source suites, including the following components:

    • Eureka: service governance component, including service registration and discovery
    • Hystrix: fault-tolerant management component, which implements a fuse
    • Ribbon: Service call component for client load balancing
    • Feign: Declarative service invocation component based on Ribbon and Hystrix
    • Zuul: Gateway component, providing functions such as intelligent routing and access filtering
    • Archaius: Externalized configuration components
  • Spring Cloud Config : A configuration management tool that realizes external storage of application configuration, supports client configuration information refresh, encryption/decryption configuration content, etc.

  • Spring Cloud Bus : events, message bus, used to propagate state changes or events in the cluster, and trigger subsequent processing

  • Spring Cloud Security : A security toolkit based on spring security to add security control to our application

  • Spring Cloud Consul : encapsulates Consul operations. Consul is a service discovery and configuration tool (similar to Eureka), which can be seamlessly integrated with Docker containers

Spring Cloud Alibaba

  • Sentinel : Regarding the flow as an entry point, it protects the stability of the service from multiple dimensions such as flow control, fuse degradation, and system load protection.
  • Nacos : A dynamic service discovery, configuration management and service management platform that makes it easier to build cloud-native applications.
  • RocketMQ : An open source distributed messaging system, based on high-availability distributed cluster technology, provides low-latency, highly reliable message publishing and subscription services.
  • Dubbo : Apache Dubbo™ is a high-performance Java RPC framework.
  • Seata : Alibaba's open source product, an easy-to-use high-performance microservice distributed transaction solution.
  • Alibaba Cloud OSS : Alibaba Cloud Object Storage Service (OSS) is a massive, secure, low-cost, and highly reliable cloud storage service provided by Alibaba Cloud . You can store and access any type of data in any application, any time, and any place.
  • Alibaba Cloud SchedulerX : A distributed task scheduling product developed by the Alibaba middleware team, which provides second-level, accurate, highly reliable, and highly available timing (based on Cron expressions) task scheduling services.
  • Alibaba Cloud SMS: A global SMS service, friendly, efficient, and intelligent interconnected communication capabilities to help companies quickly build customer access channels.

2. Divided by function

2.1 Service discovery

The core function of microservices is mainly to manage all microservices. Provide service registration and service discovery functions.

  • Eureka Eureka is a tool for service registration and discovery produced by Netflix. ZK guarantees CP, Eureka guarantees AP
  • etcd
  • Nacos is a dynamic service discovery, configuration management and service management platform that is easier to build cloud native applications.
  • Zookeeper is a distributed service framework and a sub-project of Apache Hadoop. It is mainly used to solve some data management problems often encountered in distributed applications, such as: unified naming service, state synchronization service, cluster management, distribution The management of configuration items in a distributed application, etc.
  • dubbo : Dubbo is a high-performance, lightweight open source Java RPC framework that provides three core capabilities: interface-oriented remote method invocation, intelligent fault tolerance and load balancing, and automatic service registration and discovery.
  • Archaius : Netflix Archaius is a powerful configuration management library. It is a framework that can be used to collect configuration properties from many different sources, providing fast and thread-safe access to configuration information.
  • OCTO-NS : OCTO-NS is a series of modules responsible for naming services in the Meituan OCTO service management system, including C++ SDK, Java SDK, basic agent SGAgent, naming service cache NSC, health check service Scanner, ZooKeeper, and a management platform OCTO- Portal users can easily interact with service operations. OCTO-NS implements service registration/discovery, routing grouping, load balancing, health detection and other functions based on service description information (tags+weight). Using these service governance functions, users can focus on business logic development, track the status of online services, and quickly Deal with abnormal risks.
  • Redis : Dubbo can choose it as a service discovery system.
  • Capition : Encapsulate Redis to implement a service discovery system. Simple and efficient, but the usability is much lower than that of specialized tools.

routing

  • Zuul is a service gateway tool for routing requests. The most recent zuul2 uses Netty to implement an asynchronous non-blocking programming model. A framework for edge services such as dynamic routing , monitoring, resilience, and security
  • Spring Cloud gateway : A tool that provides API gateway functions for Spring boot, which also contains features such as security processing

Link control and service governance

  • Sleuth  microservice tracking (sleuth) is actually a tool that can track the process of a user request (including data collection, data transmission, data storage, data analysis, data visualization) in the entire distributed system, and capture these tracking data. It can build a view of the entire call chain of microservices, which is a key tool for debugging and monitoring microservices
  • Zipkin graphically displays Sleuth distributed link monitoring data and explains the meaning of the fields
  • Sentinel 's role in microservices is to monitor and manage traffic, such as traffic control, fuse degradation, system load protection, etc.
  • Htrace, Apache's distributed tracing tool
  • OCTO-Portal OCTO-Portalt provides functions such as service node management, including service node display, node enabling and disabling, node weight adjustment, node deletion, etc.
  • PinPoint Pinpoint is a full-link analysis tool that provides functions such as non-intrusive call chain monitoring, method execution details viewing, application status information monitoring and so on. The implementation based on the GoogleDapper paper is similar to another open source full-link analysis tool Zipkin, but compared to Zipkin, it provides more features such as non-intrusive and code-dimensional monitoring.
  • Skywarking distributed link tracking system

Load balancing

  • Ribbon Spring Cloud Ribbon is a client-side load balancing tool based on HTTP and TCP, which is implemented based on Netflix Ribbon. Through Spring Cloud's encapsulation, we can easily convert service-oriented REST template requests into client-side load-balanced service calls.
  • Feign Feign is a declarative WebService client. Using Feign can make it easier to write a WebService client. Its method of use is to define an interface and add annotations to it. It also supports JAX-RS standard annotations. Feign also supports Pluggable encoder and decoder. Spring Cloud encapsulates Feign to support Spring MVC standard annotations and HttpMessageConverters. Feign can be combined with Eureka and Ribbon to support load balancing.

Service fusing

  • Hystrix helps you control the interaction between these distributed services by adding delay tolerance and fault tolerance logic. Hystrix achieves this by isolating access points between services, stopping cascading failures, and providing fallback options, all of which can improve the overall resilience of the system.
  • resilience4j Resilience4j is a lightweight fault-tolerant framework designed specifically for Java 8 and functional programming inspired by Netflix's Hysrix project.
  • Sentinel fuse is only a sub-function of it

Service monitoring and link monitoring

  • Cat public comment open source intrusive monitoring
  • grafna grafana is an open source application written in go language. It is mainly used for the visualization of large-scale indicator data. It is the most popular time series data display tool in network architecture and application analysis. It currently supports most of the commonly used time series databases.
  • Sping boot Admin Spring Boot Admin is an open source community project for managing and monitoring SpringBoot applications.
  • Promethues Prometheus is an open source monitoring alarm system and time series database (TSDB) developed by SoundCloud. Prometheus and Heapster (Heapster is a sub-project of K8S, used to obtain cluster performance data.) Compared with more complete and comprehensive functions. Prometheus performance is also sufficient to support tens of thousands of clusters.

Service configuration

  • Sping Config
  • Alibaba Cloud ACM
  • Nacos Config

Message bus

  • Spring Cloud Bus

Log service

  • logback

message queue

  • Kafka
  • RocketMQ is an open source distributed messaging system, based on high-availability distributed cluster technology, providing low-latency, highly reliable message publishing and subscription services
  • RabbitMQ
  • ActiveMQ
  • ZeroMQ
  • TuboMQ
  • nats : A high-performance distributed message queuing system implemented in go language. high speed

Remote call

  • gRPC
  • Dubbo
  • Thrift
  • Tars
  • OCTO-RPC

Object database

  • mysql on docker

Search platform

  • Solr
  • ElasticSearch
  • Dejavu ElasticSearch web management and monitoring, support data import and export
  • Kibana, Elastic's visualization plug-in, can be used with Elastic to visually query logs

KV database

  • repeat
  • mongoDB
  • Hbase
  • Hive

Timer

  • Alibaba Cloud SchedulerX

Distributed transaction

  • Seata : Alibaba's open source product, an easy-to-use high-performance microservice distributed transaction solution.
  • consul(Raft) :
  • zookeeper(Paxos) z

container

Encoding format

  • Json
  • Protbuf
  • Thrfit

Distributed lock

Guess you like

Origin blog.csdn.net/u013741019/article/details/103104229