Comparative analysis of micro services architecture configuration of the mainstream center?

Why do we need to configure center

Configuration with immediate effect :

Traditional static configuration To modify a configuration can only re-publish applications after modification, to achieve dynamic, you can choose to use the database, configured to sense changes in the timing of polling by accessing the database. Polling frequency of the low-aware configuration changes on the long delay, high polling frequency, sensing a change in configuration on the short delay, but the loss of performance comparison, a compromise between the need to do real-time performance. Configuration Center specifically for this business scenario, taking into account real-time and consistency for managing dynamic configuration.

Configuration management process :

Configure permissions control, gray publish relevant version management, security configuration and test format and a series of configuration management features are also part of the center can not be obtained configuration.

Open source describes the basic configuration center

Currently on the market use more configuration center :( sort of open source time)

Disconf

July 2014 Baidu open source configuration management center, have the same configuration management capabilities, but now is not maintained, most recently submitted two years ago a.

Spring Cloud Config

September 2014 open, Spring Cloud ecological components, and Spring Cloud can be seamlessly integrated system.

Apollo

May 2016, Ctrip open source configuration management center, have rights norms, process control and other features.

nacos

June 2018, Ali open source distribution center, can do DNS and RPC service discovery.

The core concept of contrast distribution center

Since Disconf no longer maintained, compare the following Spring Cloud Config, Apollo and Nacos. Spring Cloud Config, Apollo and Nacos concept in the field of configuration management is basically the same, but there are some different points, using the configuration of the process will involve some of the more important concepts.

application

Application of the basic unit of the client systems, Spring Cloud Config corresponding to the application name and the file name is associated Git up, so you can play a plurality of applications arranged mutually isolation. Apollo in an application configuration are the following (in addition to common configuration), also played a plurality of applications arranged mutually isolation. Application of the concept of Nacos weak, only one additional property for distinguishing configuration, but may be used to do the Group field application, can play a role in isolation.

Clusters

Different environments can set up different clusters, so you can play the role of physical isolation, Spring Cloud Config, Apollo, Nacos support multiple clusters.

Label Profile & environment & namespace

Spring Cloud Config Label may be used to do the logical isolation and Profile, Label for branch remote repository, Maven Profile Profile similar environments can be distinguished, such as {application} - {profile} .properties.

And Apollo Nacos namespace environment, is a logical concept, as logical isolation environment. Apollo is the name of the namespace configuration, the specific configuration item refers to a Property profile.

Comparison of configuration management capabilities

As a distribution center, the entire configuration management process should have streamlined capabilities.

Gray release

Gray publish the configuration is to configure the center of the more important functions, when changes affect the configuration of relatively large, need to verify whether the configuration change in line with expectations, and then pushed to all application examples in some application examples.

Spring Cloud Config supported by the destination parameter / bus / refresh endpoint to specify update the machine configuration, but the whole process is not automated and systematic.

Apollo may point directly on the console of the machine-gradation specified release the IP, followed by the total amount released, do systematic comparison.

Nacos currently released version 0.9, does not support grayscale release.

authority management

Configuration changes and code changes are changes to the application logic runs, it is important effect of configuration changes often bring a nuclear bomb, for permission to change the configuration control and auditing capabilities are also important configuration function center.

Spring Cloud Config rely on rights management capabilities Git and GitHub open source access control can be divided into Admin, Write and Read permissions, rights management more perfect.

Apollo authority to manage the configuration by the dimensions of the project, owner of a project can be delegated to other users permission to modify the release configuration.

Nacos the moment do not have the permission management capabilities.

Versioning & Rollback

When configuration changes are not in line with expectations when the need to rollback depending on the release configuration. Spring Cloud Config, Apollo and Nacos all have the ability to configure versioning and rollback, you can view or change the case of the configuration rollback on the console. Spring Cloud Config done by Git version management, more convenient.

Configuration format check

Configuration data stored in the application are generally arranged in a central configuration storage format, such Properties, Json, Yaml the like, if the configuration malformed, cause the client to parse the configuration fails due to production failure, the distribution center can be configured to check the format effectively prevent the occurrence of human error operation, it is arranged in the center of the core functions just need.
Spring Cloud Config using Git, test format is not yet supported, rely on the correctness of their own R & D format.
Apollo and Nacos proper format configuration will be tested, human error can be effectively prevented.

Listens for queries

When troubleshooting or statistics, you need to know which applications use a configuration instance to be, as well as an example of what configuration to use.
Spring Cloud Config using Spring Cloud Bus push configuration changes, Spring Cloud Bus compatible RabbitMQ, Kafka, and support queries Subscribe Subscribe relationship of Topic and Consumer.
Apollo can view a list of list of examples of the configuration of interception by gray examples, but the examples are listening configuration (Apollo known as a namespace) has not yet displayed.

Nacos can see examples of monitor configuration, you can also view the configuration instance is listening.

Basically, these three products have the ability to monitor query, in our own course, Nacos relatively simple to use, ease of use is relatively better.

Multiple Environments

In actual production, often need to multi-center configuration or a multi-cluster environment, service development environment may be distinguished in the development and production, or production environment, according to a plurality of different lines of business. If the interaction between the various small environment (environmental impact of the production development stability), the central configuration environment can support multiple logical isolated manner.

Spring Cloud Config Profile support multiple environments isolated way, by arranging a plurality Profile of profiles on Git, the client starts the specified Profile can access the corresponding configuration file.

Environmental Apollo also supports multiple environments, create a configuration in the console when we should specify a configuration where the client JVM parameters specified in ENV startup to access the corresponding environmental profile.

Nacos supported through multi-namespace environment, the configuration of each namespace isolation from each other, the client specifies the namespace you want to access it can achieve a logical isolation.

Multi-cluster

When the high stability requirements, environmental impact of each individual is not allowed when a plurality of environments requiring physical isolation by way of the multi-cluster.

Spring Cloud Config can set up multiple sets Config Server, Git Git use multiple warehouses of the same, to achieve physical isolation.

Apollo can build multiple sets of clusters, Apollo console and update data push services deployed separately, to deploy a console can control multiple clusters.

Nacos console and back-end configuration services are deployed together, you can switch to support multiple clusters in different domains.

Configuring real-time push comparison

When configuration changes when the distribution center need to configure real-time applications pushed to the client.

Nacos configuration and Apollo are HTTP-based push long polling, the client and the distribution center to establish long HTTP connection, when the configuration changes, the distribution center configuration pushed to the client.

Comparative analysis of micro services architecture configuration of the mainstream center?

Spring Cloud Config native does not support real-time push configuration, the need to rely on WebHook Git, Spring Cloud Bus and client / bus / refresh endpoints:

  • Git based WebHook, configuration changes trigger server-side refresh

  • Server receives the request and sent Spring Cloud Bus

  • Spring Cloud Bus received the message and notifies the client

  • The client receives a notification requesting Server clients to obtain the latest configuration

Comparative analysis of micro services architecture configuration of the mainstream center?

Overall comparison down, Nacos and Apollo in real-time push link configuration is a relatively simple and efficient, Spring Cloud Config configurations incorporated push Spring Cloud Bus, a long link, more complex.

Comparison & availability deployment structure

Spring Cloud Config

Spring Cloud Config contains config-server, Git and Spring Cloud Bus of three components:

  • config-server configuration to the client acquired;

  • Git for storing and modifying configuration;

  • Spring Cloud Bus notify the client configuration changes;

Local test mode, Spring Cloud Bus and config-server need to deploy a node, Git can use GitHub. In a production environment, Spring Cloud Config, config-server need to deploy at least two nodes. Spring Cloud Bus If you use RabbitMQ, common mode requires at least two cluster nodes.

If you are using GitHub Git service availability would not have considered the issue, if you want to take into account the safety of self-built private Git repository, the overall cost is relatively high. Web services can be deployed to support multi-node high availability, since Git has the consistency of data, high availability can be supported by the following ways:

  • Git + Keepalived cold standby mode, when the main Git hung can be cut immediately to prepare Git;

  • Git multi-node deployment, data storage or a network file system implemented using multiple nodes DRBD Git synchronization;

Apollo

Apollo into MySQL, Config Service, Admin Service, Portal four modules:

  • Apollo MySQL storage metadata and user configuration data;

  • Config Service provide read configuration, push function, client requests are dropped onto Config Service;

  • Admin Service provides modify, publish features such as configuration, operation of the Portal service is Admin Service;

  • Portal to the user configuration management interface;

Local test Config Service, Admin Service, Portal deployed three modules can be combined together, MySQL installed separately and create the table structure needed. Apollo used in a production environment, two nodes may be deployed separately Portal, stability requirements, then not so high, Config Service Admin Service and can be deployed together, database support standby redundancy.

nacos

Nacos deployment requires Nacos Service and MySQL:

  • Nacos provide services to support configuration management and service discovery;

  • MySQL provides Nacos persistent store data;

Stand-alone mode, Nacos embedded database can be used to deploy a node, you can start. If you are familiar MySQL, you want to understand the overall data flow, you can install MySQL to Nacos provide data persistence services. Production environments Nacos, Nacos service need to deploy at least three nodes, plus the MySQL master and slave.

Overall

Nacos deployment structure is relatively simple, low operation and maintenance costs. Apollo deploy more components, operation and maintenance cost is higher than Nacos. Spring Cloud Config highest production costs of high availability.

Multi-language support comparison

A company's various systems may vary language, now used by more such as C ++, Java, PHP, Python, Nodejs, Go there and so on. After the introduction of distribution center, distribution center to get multi-language systems can enjoy the ability to dynamically configured, the need to support multiple languages ​​ecology.

Multi-language support

Spring Cloud services in the Java ecosystem, initially only for Java micro-service applications for micro-services call non-Java applications, you can use Sidecar provides HTTP API, but the dynamic configuration is also not well supported.
Apollo has supported multiple languages, and provides open API. Other languages are not supported, Apollo access costs are relatively low.

Nacos support mainstream languages ​​such as Java, Go, Python, Nodejs, PHP, also provides open API.

Migration Support

Domestic mainstream Java-based Internet company is still based, in addition to native Java SDK, in the entire Java ecosystem, such as the support of Spring Boot and Spring Cloud, the three products are supported.

Spring Cloud Config original and gifted support Spring Boot Spring Cloud, Nacos support Spring Boot and Spring Cloud ecology by Spring Cloud for Alibaba, in line with the standard Spring eco implementation, can seamlessly migrate from Spring Cloud Conig to Nacos.

Apollo and Spring Cloud Spring Boot support the project, but the implementation is different from the standard, you can not do seamless migration, the migration from Spring Cloud to Apollo, there is the transformation of the code compatibility and cost.

Performance Comparison

Performance is also the configuration of a ring around the center but, at the same specifications of the machine, if they can support a greater volume of business is bound to save more resources costs for the company, improve resource utilization. Application client have to configure the interface operations center read, write and change notification, due to the change notification requires a lot of client instance, a bad simulation test scenarios, below only read and write operations to do the test.

Hardware environment

Nacos Apollo and use the same database (32C128G), the deployment container 8C16G configuration of the machine to use the Server service, the disk is 100G SSD.

version

Spring Cloud Config using 2.0.0.M9 version, Apollo using the 1.2.0 release version, Nacos 0.5 version.

Single reading scene

The client test program by deploying multiple machines, each machine to open multiple threads to read different configurations (3000) from the distribution center. Nacos QPS can reach 15000, Apollo and read into the read buffer memory in two ways from the database, can be read from a database of 7,500, from the cache memory read performance can be achieved 9000QPS. Spring Cloud Config using jGit write Git, because of client restrictions, stand-alone reading ability is limited 7QPS.

Scene 3 Node Reading

The center of pressure measurement nodes are arranged into three nodes deployed. Nacos QPS can reach 45000 QPS, Apollo read memory cache up to 27000 QPS. And Apollo Nacos since each node is independent of the read scene, is three times the basic relationship between the read single scene. Spring Cloud Config three nodes reading ability can reach 21QPS.

Write stand-alone scenario

The same way, multiple machines simultaneously modify the central configuration different configurations. Nacos QPS can reach 1800, Apollo default database connection pool of unused (10) QPS only reach 800 QPS (CPU not full pressure), to adjust the connection pool 100 may reach 1100 QPS (CPU full pressure). Git will be locked at the time of submission of the same project, stand-alone Git can write about 5QPS, Spring Cloud Config when used as a data source to a project, Git write capability is limited.

3 write a scene node

The same way, the center of pressure measurement nodes are arranged into three nodes deployed. Nacos QPS up to 6000, Apollo can reach 3300 QPS (CPU full pressure), then MySQL database because high profile, not become a performance bottleneck. Spring Cloud Config three nodes time, Git is a node, write QPS 5.

On the whole, the highest read and write performance of Nacos, Apollo followed, Spring Cloud Config depends Git scenes not suitable for large-scale automated operation and maintenance of open API.

Features comparison summary

Here is a list a table to summarize the features of the three products.

Comparative analysis of micro services architecture configuration of the mainstream center?

Overall, Apollo and Nacos with respect to ecological Spring Cloud Config broader support in the configuration management process to do better. Apollo relative Nacos do more comprehensive configuration management, but also use some work. Nacos is relatively simple to use, more suitable for high performance requirements of large-scale scenes.

In addition, Nacos addition to providing configuration-centric features, also provides a dynamic service discovery, service sharing and management functions, reduces the difficulty of service transformation process.

Above, from product functionality, user experience, implementation and performance of four latitude to Spring Cloud Config, Apollo and Nacos comparison. But for the selection of an open source project, in addition to the above four aspects, human input (iteration progress, the integrity of the document) on the project, activity community (issue number and address speed, Contributor quantity, community exchange frequency, etc), the content of the degree of community norms (Disclaimer, safety instructions, etc.), which may be what users are more concerned about.

Written in the last:

I welcome everyone's attention [number of public calm as code ], mass Java-related articles, learning materials will be updated on the inside, finishing materials will be on the inside.

I feel good to write on a point of praise, plus followers chant! Point of attention, do not get lost, continuously updated! ! !

Massive interview, information-sharing architecture

Comparative analysis of micro services architecture configuration of the mainstream center?

Guess you like

Origin blog.51cto.com/14570694/2480560