Author: Yu Huai

What is Nacos?

Nacos / : kəʊs / is the acronym for Dynamic Naming and Configuration Service, which is positioned as a dynamic service discovery, configuration management and service management platform that is easier to build cloud - native applications. Since the announcement of open source in July 2018, it has gone through the fourth year. In the past four years, it has been welcomed by the majority of open source users, with a total of 23.3K stars and 10.3K forks , released in open source China In the 2021 OSC China Open Source Project Selection, Nacos was rated as the Top 5 project in the cloud native field popularity index , released the e-book "Nacos Architecture and Principles" with 6w+ readings, 2w downloads , and published the scriptures in Alibaba Cloud within half a year. The top ten downloads in the history of the pavilion. Nacos continues to grow under the common construction of the community, and gradually begins to help users solve practical problems and facilitate the digital transformation of enterprises. At present, it has been widely used in domestic companies. According to the questionnaire in the field of microservices, Nacos has become a registered configuration center in the field. The first choice in China, occupying 50%+ domestic market share , widely used by leading enterprises!

"2022 China Open Source Development Blue Book" is led by China Open Source Software Promotion Union (COPU), in conjunction with China Developer Network (CSDN), Beijing Open Source Innovation Committee, Open Atom Open Source Foundation, China Institute of Electronic Information Industry Development, and Institute of Software, Chinese Academy of Sciences 85 companies and industry organizations, more than 120 open source experts and volunteers have worked together to compile and complete the compilation. It aims to comprehensively display the current panorama of China's open source development, and serve the relevant national government management departments, scientific research institutes, technology enterprises and open source practitioners. Provide more theoretical reference and data support to further help the vigorous development of my country's open source ecosystem.

According to the recently released "2022 China Open Source Development Blue Book" report, Github China's project activity is TOP 20, and Nacos ranks sixth in the country . As a basic type of cloud-native middleware, it is not easy to have such activity. In the last year's "2021 China Open Source Development Blue Book", Nacos ranked tenth in the country, which also shows that Nacos not only maintains a high degree of project activity, but also gradually increases project attention and activity.

 title=

 title=

At the same time , Alibaba ranks first in open source influence among domestic enterprises. In the "2022 China Open Source Development Blue Book", it is introduced: "Alibaba is a model of enterprises participating in the ecological construction of open source technology in China. Since 2011, Alibaba has accumulated more than 3,000 open source projects. Representative projects include Dragon Lizard Operating System, Apache RocketMQ, Apache Dubbo, Spring Cloud Alibaba, Nacos, Seata, PolarDB-X, PolarDB for PostgreSQL, etc."

Nacos is the most active open source project in Alibaba's microservices field . It also benefits from the open source collaboration model. In Nacos, there are a large number of core contributors from well-known domestic and foreign companies, including those working in Tencent, Huawei, Xiaomi, etc. It is also the contributors and users of the community as a whole who are helping Nacos grow, allowing Nacos to gradually improve its ecology, support almost all mainstream languages, and integrate more open source ecosystems. It is also users and community contributors who make Nacos the The preferred product for enterprise digital transformation.

 title=

3 important tips for using Nacos

Nacos version selection

After 4 years of development, Nacos has reached the second-generation Nacos architecture in the evolution of the major version, namely Nacos 2.x version. Nacos 2.x version is based on Nacos 1.x. User feedback usage habits and product evolution direction are built. Its product capabilities include, for example, the upgrade of the consensus algorithm, a 10-fold improvement in performance, and support for plug-ins to meet the community's customized demands. And it guarantees good compatibility. In terms of service capability, Nacos 2.x is fully compatible with Nacos 1.x protocol, that is, Nacos 2.x server is fully compatible with Nacos 1.x client.

 title=

In terms of basic capabilities, the Nacos 2.x consistency protocol reuses Alibaba's best practices in this field. It is based on long connections to reduce communication loss, and is upgraded based on the original protocol of the Distro protocol. In terms of storage model and keep-alive model It has been refactored, and the previous rotation training mechanism has been replaced by the push mechanism, which further improves the high availability and stability of the product. The basic model of Alibaba's millions of instances is also reused as a whole. Based on the CAP theory, it comes and goes according to the scene. Choose the most suitable protocol and fit the scenario to balance consistency, high availability, and partition disaster tolerance, so as to achieve service discovery and configuration management in each scenario, to ensure stability, high availability, and high performance.

 title=

In terms of expansion capabilities, Nacos 2.x version starts to support plug-in capabilities. Based on plug-in, it is more convenient to support various scenarios of users. Many user companies have a complete system based on Nacos and can be integrated into it by simple transformation. Encryption and decryption scenarios can be customized according to user needs, and the default open source implementation is given for users to choose. For example, encryption and decryption is an example. The default implementation given by open source is based on AES, and users can also customize it. And the plug-in of the database is already on the way, and the pluggable plug-in capability will be supported in more aspects such as security in the future.

 title=

What other scenarios does Nacos support support?

The basic core capabilities of Nacos are for overall distributed service registration and discovery, as well as distributed node configuration management. The fields of use can be said to be very extensive, and the more commonly used fields include microservices, high availability, content, and databases. etc. At present, the basic capabilities of Nacos are the most widely used in the field of microservices. The field of microservices is positioned as a one-stop service platform that solves the addressing, traffic, and configuration scenarios of user applications. In the field of high availability, Nacos has accumulated a lot of experience and can achieve A large number of high-availability scenarios of downgrading, disaster recovery, and multi-active can also support the basic capabilities of content distribution, database sub-database sub-table, active-standby switching and other scenarios. It can be said that in distributed scenarios, it can basically be built with Nacos. It also helps to prepare enough for subsequent business expansion.

 title=

Nacos Troubleshooting Best Practices

The registration configuration center plays an important role in the interaction of distributed nodes. When there is a problem in the distributed business scenario, a quick diagnosis is required to determine whether there is a problem with the registration configuration center or the business layer.

 title=

In the registry, service discovery is the first priority for business troubleshooting. Service discovery corresponds to whether the service address data is synchronized to the business node. In the Nacos scenario, push records are the most critical feature capability. , This part of the ability can be queried through the Nacos log. At present, the Nacos community has begun to plan to design an event center to support this part of the ability. For a better demonstration, here is the white-screen push trajectory capability through the Alibaba Cloud microservice engine MSE. , the user can query the time of change and the content of the change through the service name or client IP, and can quickly determine whether there is a problem in the current registration center, and can help the business to further locate the specific cause.

 title=

In the configuration center link, there is also the problem of first-time positioning. Here, the best practice of Alibaba Cloud's microservice engine MSE is used to show the idea of the tracking capability. You can query and configure by configuration name or subscriber client IP. Change time, push time, and push content MD5 value to match.

 title=

And in the field of distributed configuration management, by complementing the push trajectory capability and the already supported historical version query capability, it can help observe the configuration life cycle of the entire business process.

 title=

Regarding the thinking of the registration and configuration center troubleshooting, the summary is two key points, one is to confirm the data change, and the other is to quickly determine the relationship and restore it. If most scenarios are caused by business changes, you must review the changes as soon as possible to avoid causing problems to the business. In areas with high stability requirements, it is recommended to build stability for the business system based on 1-5-10 (1 minute for fault discovery, 5 minutes for online processing, and 10 minutes for recovery). We will expand in detail, and we will have the opportunity to talk about it separately in the future.

Nacos Planning

Nacos has gone through two important stages, the initial stage and the high-speed development stage. The third stage of Nacos, which is currently being used on a large scale, is to become an infrastructure. It needs to evolve towards the infrastructure, help enterprises to digitally transform, and deeply embrace Scenarios in various fields, and help enterprises solve problems more deeply. The Nacos community is currently facing the third stage, starting to prepare for the Nacos 3.0 architecture design for planning discussions, and gradually begin to implement it.

At present, the construction plan for Nacos 3.0 mainly includes three parts. The first part is the upgrade of the open source brand and community, which is mainly for establishing a closer relationship with the community. The second part is for in-depth integration of more ecosystems, including K8s data integration and multi-ecological data integration. The third part is the most basic part, product capability upgrade, enhancement based on the Nacos2.x protocol, and support for a unified control plane , multi-data center and other basic capabilities to support Nacos 3.0 ecological construction and brand upgrade.

At present, the Nacos 3.0 part has been carried out with the core contributors of the community, and most of them are still in the planning stage. They will be opened up through Github issues in the future, and will be labeled as Nacos 3.0. Everyone is welcome to collect and participate in the contribution of Nacos 3.0.

 title=

Participate in open source advice

The last part integrates my personal opinions and gives some suggestions for participating in open source to students who have not participated in open source. First of all, I think open source is very beneficial to developers and community contributions. If you have time and want to participate in open source, then I It is recommended that you proceed from the following four steps:

The first step is to find the direction you are interested in. This point is more important and will affect the durability of your subsequent contributions. Of course, this is also gradually being explored, but if the direction is confirmed, the list of products to deal with will be more clear. Now, considering interest in this step is my first suggestion. Secondly, I suggest that you can also consider some details of the current project, focusing on whether it can help individuals to amplify the value. The wider the scope of the project, the more you can contribute. Amplifying social value will also positively increase the sense of achievement.

The second step is to get familiar with the project and product. After finding the direction and project, you can start to familiarize yourself with the details of the current product, familiarize yourself with the operation mechanism of the current project, and start contacting the corresponding field problems for the product. The field problems will eventually settle into you. experience in this field.

The third step is actually to contribute to open source. This step is actually for the first two steps, which can be done in parallel in advance. The key is to start with small problems, which can help you find the feeling faster in the first two steps. You can also help others by starting with small problems and build personal influence in the community.

The fourth step is actually a matter of course, for an active community. After you are familiar with the product in the field and have enough contributions, you will gradually lead the decision-making of the community in open source, and you can also help more in the community. People develop and build together.

 title=

The above is a suggestion for the process of personal contribution to open source products, which applies to contributions to most open source projects. In terms of open source, I think Nacos is a good choice. First of all, the product positioning is relatively basic, which can help developers to accumulate more general domain capabilities. The community activity can maintain the sixth in the country, and it has been widely used in the field of microservices. Help the individual to amplify the value very well.

The familiar Nacos products will also be relatively simple. The official website of Nacos.io can help you get started quickly, and there are free downloads of Nacos e-books to help you deeply understand the Nacos architecture design. Contributing to open source can start with good first issues in the Nacos community repository, follow the direction of product evolution, and start speaking in the community from trivial matters. Finally, there are many core modules in the Nacos community that need leaders, and there is a community to become a core contributor in the community. Voting rights will lead the future development direction of Nacos, and as a core member of the community, there will be many opportunities to share online and offline, helping individuals and enterprises to build more social influence. In short, in the field of open source, as long as you are willing to be familiar with it, you will definitely gain something. I wish every developer can make the products you want in their favorite fields. Finally, thanks to every student in the Nacos open source community!

MSE registered configuration 20% off the first purchase, 30% off the first purchase of 1 year and above. 10% discount for MSE cloud native gateway prepaid full specification. Click here to take advantage of the discount!


阿里云云原生
1k 声望302 粉丝