Source | alibaba cloud native public number

On March 20, Nacos 2.0 was officially released. Nacos is a dynamic service discovery, configuration management and service management platform, which is easier to build cloud native applications, opened by Alibaba in 2018. It can also be understood as registry + configuration center of micro services.

Nacos has achieved good results in both user acquisition and open source community operations. According to Li Yanlin, co-founder of Nacos, in a developer survey of a sample of 2,245 people, 49% of the users choose Nacos as the registry. Nacos is already the first choice for domestic developers in the same field.

In addition, more than 80% of contributors to the Nacos open source community come from outside Alibaba, contributing about 20% of the code of Nacos, especially the multi-language part of Nacos, all contributed by external developers, and maintaining a good iteration speed.

Compared with the 1.x version, Nacos 2.0 performance has been improved by 10 times, the kernel has been layered abstract, and the plug-in extension mechanism has been implemented. In the future, Nacos plans to complete the integration of Nacos multilingual ecology and cloud native ecology by integrating mainstream Sidecar technology.

To learn more about how Nacos completed the 2.0 architecture upgrade and achieved 10x performance improvement, as well as the Nacos community operation experience and future plans. OSCHINA invited the co-founder of Nacos to give us an in-depth explanation.

Nacos for microservices = Etcd for K8s

Q: First, would you like to introduce yourself, such as your personal background and how you got involved with the Nacos project?

A: Hello, everyone. I’m Li Yanlin, flower name Yanlin, head of Ali Cloud Soft load team and co-founder of Nacos. Founder of MSE, Alibaba Cloud products.

With the increasing impact of open source on the cloud computing industry, Ali increased its investment in open source in 2018. I was fortunate to participate in the open source work of Nacos, providing developers with complete microservice solutions around Dubbo/ Spring-Cloud-Alibaba Micro-service ecology.

Q: Would you like to introduce the birth and development history of Nacos?

A: Nacos originated from the Multicore project in Alibaba in 2008 (completed micro-service separation and business platform construction), grew up in the double eleven test of the decade, and accumulated the core competitiveness of simplicity, reliability and excellent performance. With the rise of cloud computing, we deeply feel the influence of open source software industry in 2018, therefore decided to Nacos (ali internal Configserver/Diamond/Vipserver kernel) open source, output ali 10 years of precipitation, promoting the development of micro service industry.

In 2018, we officially open source Nacos, and it quickly became the most concerned open source product in China. Huya was also the first to follow and participate in the development of Nacos, and mass production was implemented, and the following video industry quickly followed and adopted it.

2018 Nacos open source, meetup @Shenzhen

In 2019, we released THE 1.0 version of Nacos, which marked the stable and mature functions of Nacos and supported almost all microservice frameworks and programming languages. As a result, Nacos was widely used and entered a period of rapid development.

Nacos Meetup @ Hangzhou

At the beginning of the New Year of 2020, the number of Nacos Star exceeded ten thousand, and we have successively released multiple versions of 1.X, complete the abstract layer of storage and consistency model, the architecture is clear and robust, and Nacos has entered the large-scale use period.

In 2021, we released Nacos2.0 version, which improved the performance by ten times, and Nacos entered the second development curve. With performance, high availability and ecology as the core competitiveness, Nacos continues to maintain rapid development.

Q: How do you think Nacos stands in the cloud native middleware arena?

A: First of all, Nacos has been the first choice of domestic developers in the same field. After the release of Nacos 2.0, the developers initiated A survey to see the options in the registry. According to the survey results, 49% of the developers chose Nacos. With the release of 2.0, Nacos is expanding its competitive advantage.

The registry and configuration center represented by Nacos are the most core services in the cloud native middleware, because the first thing to solve after distribution is the addressing problem.

I can also make an analogy that Nacos is to microservices the same as Etcd is to K8s.

2.0 Architecture Upgrade

Q: How does Nacos 2.0 improve the performance of service discovery and configuration management by 10 times? What are the specific scenarios and test methods? What technical architecture upgrades are behind this?

A: Considering the simplicity and ease of use in the open source in 2013, we made some trade-offs based on the internal product kernel. For example, the communication protocol was changed to HTTP mode, which was simple and easy to implement in multiple languages, but the performance of short links was indeed A little weaker.

In terms of service model, we have two types of patterns: persistent and non-persistent. When we open source, we consider the persistent pattern to provide more service governance capabilities. However, after a period of development, we find that the mainstream scenarios outside are non-persistent services, but there are also some holes for performance problems. Of course, we now do a good abstraction and unity to better solve this problem. The performance improvement is most obvious for Dubbo and Spring-cloud-Alibaba, the most conventional nonpersistent services.

The test method is to build several typical load models for key usage scenarios of the service and configuration.

The core upgrades communication protocols, conformance models, architectural layers, and abstractions.

Q: Were there any technical problems during the 2.0 upgrade? How were they solved?

A:

  • Long link protocol selection: we have a private long link protocol in the market, there are gRPC/Rsocket two mainstream choices, we must do a good extension abstract for compatibility, for easy implementation and integration of multiple languages we also did a lot of pressure testing. Finally, gRPC was chosen. From the perspective of model, Rsocket’s push model is more suitable for Nacos, and gRPC is more suitable for ecology and multi-language support. We choose gRPC for comprehensive balance, and make extension, so as to have a better choice in the future.
  • Service consistency model: The underlying services of Nacos are divided into persistent services and non-persistent services, and there are big differences in consistency patterns and storage modes. After a long time of grinding, we have abstracted and integrated the model to give full play to the performance of each scenario.
  • Seamless upgrade solution: Generally, cross-generation upgrade of open source product protocols is basically without consideration of compatibility. However, since Nacos has a wide user base, we still spend huge energy on compatibility, so that all users can upgrade to enjoy these dividends.

Q: IT is said that There are millions of cases in Ali. What do you mean? Could you elaborate? A: In 2020, in the face of the big trend of cloud native and the scale of Alibaba’s internal instances exceeding one million, we launched the middleware 4.0 project to solve the problems of scalability and standardization. An instance refers to a microservice instance node, a microservice instance node. For the Nacos model, one of the key performance indicators is the instance size (business release start write frequently) and the other is the service size of single instance registration (need to maintain the heartbeat consumption memory and network). Later we can find a separate opportunity, I will share with you the practice of Ali Million instance soft load in detail.

2020 Internal KO, middleware 4.0 opens the era of cloud native middleware

Q: How is Nacos landing in and out of Ari? Can you give us a comparison?

A: At present, Nacos has completed the construction of the trinity of self-research, open source and commercialization. Alibaba’s internal business domains such as Nandao, Kaola, Ele. me and Youku have all adopted Nacos services in the cloud product MSE and seamlessly integrated with the technology stack of Alibaba and cloud Native.

Development planning and commercialization

Q: In the Nacos 2.X program, there are many aspects of plug-in optimization. What are the reasons and goals for this design?

A: With the increasing size of Nacos code base, the previously tightly coupled code is not convenient to expand, has high user customization, and can not be submitted to the community, such as security function. Therefore, the extension mechanism can improve users’ customization ability according to their own scenarios, and of course, it can better integrate with each ecology.

Q: In the official announcement of version 2.0, it is mentioned that Nacos will further explore the direction of Mesh in the future. Does the Mesh here refer to the Service Mesh? Are there any technical difficulties? What are the specific things to do?

A: Yes, because Service Mesh can better solve the multilingual problem through Sidecar mode, we expect to complete the integration of Nacos multilingual ecology and cloud native ecology by integrating mainstream Sidecar technology.

The core is that Istio’s current performance indicators are still challenging, and Sidecar’s current automatic grayscale upgrade is a challenge, which is controllable for smes.

Q: As a product, does Nacos prefer to support Alibaba’s business or to develop more external users? If the latter, do you have a general business plan?

A: Since 2020, Aliyun has put forward the concept of “Trinity”, which is to form A unified technology system of “self-developed technology”, “open source project” and “commercial products” to maximize the value of technology. Expand ecology through open source, build high performance and high availability capabilities through Ali Group scenarios, and build productization capabilities through cloud products.

In January 2020, we released the corresponding commercial product of Nacos — Micro Service Engine (MSE), and provided commercial services externally. It is a one-stop microservice platform for mainstream open source microservice ecology in the industry, providing full hosting of registry and configuration center (compatible with Nacos/ZooKeeper/Eureka), Gateway (compatible with Zuul/Kong/Spring Cloud Gateway), And non-intrusive open source enhanced service governance capabilities.

In 2020, we will use EDAS, Dubbo, RocketMQ, AHAS, ARMS, MSE, PTS and other Alibaba Yunyun products to support the Singles’ Day, so that we can be on the same “plane” with customers. It can be said that Alibaba Group is the largest public cloud user of Aliyun. At present, a large number of businesses have been running on Nacos hosted by Aliyun MSE. It is expected that alibaba Group will 100% run to our public cloud products on The Singles’ Day in 2021. At present, tens of thousands of enterprises on AliYun have adopted Nacos hosted in our commercial product MSE, and we will increase investment in this, in order to better serve aliyun users.

Finally, we hope that the majority of developers can enjoy the technical dividends of Ali Microservice system through the open source of Nacos; In addition, through the scale effect of Aliyun, enterprise users can obtain more stable and more economical product dividends than open source self-built product through Nacos commercial product MSE.

Nacos open source community

Q: After the release of Nacos 2.0, there was an enthusiastic response from developers. Why and how is developer maintenance done?

A: First of all, AFTER nearly three years of development, Nacos has become the first choice in China with A broad mass base. Secondly, Nacos2.0 is a cross-generation product with a performance improvement of ten times. It sincerely contributes to ali’s core capabilities. Finally, I would like to thank media friends for promoting good products and technologies on a large scale in this open era.

We simply divide the developer relationship into contributors and users. For hundreds of contributors, we exchange some cutting-edge technology ideas and contribution ideas through regular weekly meeting mechanism, and grant different community reputations according to the contribution level to help our contributors expand the influence of technology.

For users, we communicate with each other through regular meetups and by asking users to share best practices. Thus forming a positive cycle. In addition, we attach great importance to lowering the threshold for novice users to use Nacos, so we have invested a lot of energy in the construction of documents and tutorials. This year, we will be launching a complete tutorial on getting started with Nacos at the Knotek Hands-on Lab to help developers get started.

Q: What is the status of the Nacos open source community? Has the composition of contributors been investigated?

A: At present, it should also be the 80-20 rule. More than 80% of the contributors are outside, contributing about 20% of the code of Nacos, among which Chuntaojun, KeRan213539, PaderLOL, Horizonzy and other friends keep contributing. This is of great significance to Open source in China, especially the multi-language part of Nacos, which is all contributed by external developers and maintains a good iteration speed.

In the community digital operation, we jointly x-Lab, through the data, automated way, clearly show Nacos and target project activity, attention trends, and community collaboration network map, can quickly locate the active developers in the community.

I’d like to take this opportunity to thank our more than 200 friends who contribute code to Nacos! We also hope that more partners can participate in the Nacos open source work to make Nacos stronger.