Author | Pan Shengwei, Dong
The service framework is just like the railroad tracks, it is the basis of intercommunication. Only by solving the intercommunication of the service framework can it be possible to complete higher-level business intercommunication. Therefore, the same standards are used to unify, and the two are combined to build a new generation of services. Framework is an inevitable trend.
Dubbo 3.0 is a fusion of Dubbo 2.0 and HSF, and is the only standard service framework for internal business, commercialization, and open source in Alibaba Economy.
Selection and Practice of Alibaba Service Framework
Practice of Dubbo and HSF in Alibaba
Dubbo and HSF are both microservice RPC frameworks currently used by Alibaba.
Dubbo, after being open sourced in 2011, has quickly become a popular microservice framework product in the industry, and is widely used at home and abroad. The Dubbo project was born in 2008 and was initially only used in an Alibaba internal system; in 2011, Alibaba B2B decided to open source the entire project, and it took only one year to harvest a large number of users from different industries; in 2014, due to the internal team Due to adjustments, Dubbo was temporarily suspended; in September 2017, Dubbo 3.0 restarted open source, and was incubated and graduated by Apache in May 2019, becoming the second project donated by Alibaba to graduate from Apache.
HSF is used more in Alibaba, undertaking the internal architecture evolution from monolithic applications to microservices, and supporting Alibaba’s stable operation of Double Eleven over the years; since the first version 1.1 was released in May 2008, it has undergone several years of iteration , HSF has gradually evolved from a basic RPC framework to an easily extensible microservice framework that supports ten trillion calls per day. In internal scenarios, users can select a small number of configurations to easily access the microservice system and obtain high-performance and stable service calls. You can also expand the HSF according to your own business needs to enhance the ability to obtain the entire link.
For the needs of the group, stability and performance are the core. Therefore, the HSF, which has been tested in e-commerce high-concurrency scenarios, was selected as the core of the new generation service framework. Subsequently, HSF launched the 2.0 version, and reconstructed the main problems of the previous version of HSF, which reduced maintenance costs and further improved stability and performance. HSF2.0 solves the problem of frame extensibility such as opaque communication protocol support and opaque serialization protocol support. Based on the Java version of HSF2.0, the group has also evolved CPP/NodeJs/PHP and other multi-language clients. Since HSF is also compatible with the Dubbo protocol, the original Dubbo users can smoothly migrate to the new version. Therefore, the HSF was launched in the group soon after the launch. The number of deployed servers reached hundreds of thousands, which basically completed Alibaba. The unification of the internal microservice framework has been verified by the zero-point traffic peak of Double Eleven for many years.
Challenges and opportunities of next-generation microservices
However, the development of the business and the iteration of the framework itself make the simple compatibility of the two frameworks from the protocol layer unable to meet the needs. With the continuous development of cloud computing and the widespread dissemination of cloud native concepts, the development of microservices has the following trends:
- K8s has become the de facto standard for resource scheduling, and Service Mesh has been gradually accepted by more and more users from its proposal to its development. Shielding the underlying infrastructure has become a core evolution goal of the software architecture. Whether it is Alibaba or other enterprise users, the problems facing them have changed from whether to go to the cloud or not to how to smoothly and steadily migrate to the cloud at low cost.
- Due to the diversified path to the cloud and the transition from the existing architecture to the cloud-native architecture, the facilities for deploying applications are flexible and changeable, and the microservices on the cloud are also showing a diversified trend. Cross-language, cross-vendor, and cross-environment calls will inevitably give rise to unified protocols and frameworks based on open standards to meet interoperability requirements.
- The access to back-end services on the end has an explosive growth trend, and the scale of applications and the scale of the entire microservice system have grown accordingly.
These trends have also brought new challenges to HSF and Dubbo.
Challenges facing HSF and Dubbo
The microservice framework is a basic component, and most companies need to decide to use a certain framework in the early selection or business development to a certain scale. A stable and efficient self-developed framework usually requires a long period of iteration to polish and optimize. Therefore, most companies tend to use open source components in the early stages. For Alibaba Cloud, this brings about a problem: the HSF framework is used internally, while most users on the cloud use the open source Dubbo framework. The two frameworks are in terms of protocol, internal module abstraction, programming interface and function. There are differences in support.
How to make the best practices and cutting-edge technologies of the internal components of the Alibaba Group that use HSF be output to the cloud more simply and directly, this is a problem that every student who does technology commercialization will encounter and must solve. In fact, we have also made some explorations. The HSF framework was the first to promote the microservices on the cloud. When the closed source components are output on the cloud, for many users, there is no way to troubleshoot problems after encountering them. The whole service framework is one for them. The components of the black box. We found that this is not a very good productization direction. When exporting on the cloud, we must choose to embrace the open source approach, focusing on Dubbo and Spring Cloud frameworks.
At the same time, there are also many problems within the group due to the simultaneous existence of HSF and Dubbo frameworks. How to quickly integrate the technology stack of the original department or company into the existing technology system is an inevitable problem. A typical example is Koala who joined Alibaba in 2019. Koala has always used Dubbo as a microservice framework before, and built a large-scale microservice application based on Dubbo. The cost of migration is high and the risk is also high. The infrastructure departments of the Group and Koala need to spend a long time on pre-migration research and program design to ensure that they are basically feasible before starting to make changes. From batch gray scale launch to the final full launch. This type of exchange-style change not only requires a lot of manpower, but also has a long time span, which will affect the development and stability of the business. At the same time, due to historical reasons, there are always a certain number of Dubbo users within the group. In order to better serve these users, the HSF framework is compatible with Dubbo's protocol layer and API layer. However, this compatibility is limited to interoperability. With the development of the Dubbo open source community for many years, this basic compatibility has major disadvantages in terms of disaster tolerance, performance, and iterability. At the same time, it is difficult to align with Dubbo's service governance system. There are also risks in terms of stability, not to mention the inability to enjoy the technological dividends of the group's technological development and the evolution of the Dubbo community.
The root cause of these problems is that closed-source HSF cannot be directly used for the majority of cloud users and other external users, and the challenge of open-source products to closed-source products will intensify with the continuous development of open source and cloud. The sooner this problem is resolved, the lower the cost of cloud native migration between Alibaba and external enterprise users, and the greater the value generated.
Therefore, the integration of HSF and Dubbo is the general trend. In order to better serve internal and external users, and for the better development of the two frameworks, Dubbo3.0 and HSF3.0, which use Dubbo3.0 as the core to adapt to the group's infrastructure ecology, came into being.
The final choice of the service framework under the trinity strategy Dubbo3.0
Under the premise that the original feature set is fully compatible with API, Dubbo 3.0 also has the following new features facing cloud-native challenges
- Dubbo 3.0 supports a new service discovery model. Dubbo 3.0 tries to start with the application model, optimize the storage structure, align with the cloud native mainstream design model, and avoid interoperability problems caused by the model. The new model is highly compressed in data organization, which can effectively improve performance and cluster scalability.
- Dubbo 3.0 proposes the next-generation RPC protocol-Triple. This is an open new protocol designed based on HTTP/2 that is fully compatible with the gRPC protocol. Because it is designed based on HTTP/2, it is highly gateway-friendly and penetrating; it is fully compatible with the gRPC protocol and is naturally multilingual It has advantages in interoperability.
- Dubbo 3.0 is geared towards cloud-native traffic governance, and proposes a set of unified governance rules that can cover scenarios such as traditional SDK deployment, Service Mesh deployment, VM virtual machine deployment, and Container container deployment. It supports one rule to govern most scenarios and greatly reduces traffic. Governance costs make it possible to govern global traffic under a heterogeneous system.
- Dubbo 3.0 will provide a solution for accessing Service Mesh. For Mesh scenarios, Dubbo 3.0 proposes two access methods. One is Thin SDK mode. The deployment model is exactly the same as the current mainstream deployment scenario of Service Mesh, while Dubbo will slim down. , Shielding the same governance functions as Mesh, and only retaining the core RPC capabilities; the second is the Proxyless mode, Dubbo will take over the duties of Sidecar, actively communicate with the control plane, and apply cloud native traffic based on the unified governance rules of Dubbo 3.0 Governance function.
The evolution of the service framework in the direction of Alibaba Cloud's commercialization
For the microservice framework, it is still very challenging to commercialize because it is related to the customer's business code.
First of all, in terms of migration costs, we hope to reduce migration costs to zero. Initially, we sold the HSF + EDAS Container architecture on the cloud. Therefore, when customers go to the cloud, they have to modify their own business codes. In addition, since the code is not open source, troubleshooting is also a very headache. Later, we found that most of the microservice frameworks of our customers will choose the open source Dubbo/Spring Cloud, but the customer has a self-built registry, if you want to go to the cloud You also need to migrate your registry to the MSE registry. This process requires users to modify the code. Generally speaking, a dual-registration scheme is adopted. On the cloud, we found that we promoted customers to make code transformations, including SDK upgrades. It is a very difficult thing. Many customers' Dubbo versions are still in the 4-5 years version. Not only do they need to pay attention to R&D, testing, and operation and maintenance, but also need scheduling support. This action will consume a lot of human resources. At the same time, it faces many stability challenges. This step alone will block many customers. In order to solve the problem of customer SDK upgrades, we are thinking, can we not migrate the registry? It is best to deploy to the cloud without changing one line of code. It is necessary to provide the same service governance capabilities. Therefore, we propose a technology based on Java Agent bytecode enhancement to help users use cloud products without changing a line of code, so that customers can be up and down at any time without binding, allowing customers to compare Reassured cloud products, at the same time, we also provide a more capable custodial registry center for operation and maintenance.
Regarding the choice of commercialized micro-service framework, our attitude has always been to embrace open source.
We also need to provide differentiated service governance capabilities based on the open source microservice framework. The problems of the traditional open source microservice framework on K8s are gradually exposed in the process of going to the cloud. Through a series of exchanges with customers, we have summarized the major pain points of microservice governance under the customer's cloud native, including lossless online and offline during the microservice publishing process, label routing, service authentication, and outlier instance removal. Full-link grayscale, etc., through Java Agent technology, we have solved the above-mentioned problems without the user changing the code. Through customer communication, collecting requirements, falling into the product, and verifying that this model runs through the customer’s demo. The function is constantly enriched. In addition to Java Agent, we use Service Mesh, WASM and other technologies for multi-language scenarios, and also support customers without modifying a line of code to have service governance capabilities and experience consistent with Java applications.
At the same time, we have made some attempts and choices in the choice of Java Agent. At the beginning, we used the Java Agent developed by closed source. Each cloud product has a corresponding Java Agent, which will cause too many Java Agents and Agent conflicts. At the same time, the Java Agent that we maintain is closed source. After stepping on some pits, we decided to use Arthas One Agent to reconstruct the agent of the service governance system and combine the governance-related agents into one. At the same time, the Java Agent of our base also uses the strategy of embracing open source. We use the open source Arthas One Agent.
Dubbo3.0 conforms to this direction. Through Dubbo3.0 + Java Agent, the technology development of the group, the evolution of the Dubbo community, and the technical dividends of commercialization practices are continuously and continuously output to customers on the cloud.
Service governance seamlessly supports Dubbo3.0
Three solutions related to microservice governance on Alibaba Cloud: MSE (microservice engine, providing microservice governance capabilities), EDAS (full life cycle managed application platform), SAE (Serverless application platform with elastic scalability), Both EDAS and SAE have deeply integrated MSE service governance capabilities; all of MSE's service governance capabilities are available out of the box, supporting all open source Dubbo and Spring Cloud frameworks on the market in the past five years, including Dubbo 3.0. You do not need to modify a line of code and configuration , You only need to connect your Dubbo 3.0 application to EDAS/MSE/SAE. Including the lossless online and offline capabilities in the microservice publishing process, aligning the life cycle of microservices and K8S POD; label routing capabilities weaken the binding dependence on IP, service authentication, outlier instance removal, full link grayscale, Service mock, service monitoring, service contract, etc.
How to seamlessly upgrade an HSF application to a Dubbo 3.0 application
The Trinity is Alibaba's "self-research", "open source", and "commercialization" adopting a unified technical system. Under this technical direction, the design and implementation of Dubbo 3.0 realizes the technical unification of HSF/Dubbo, and it is also rapidly developing within the group. Promotion is in progress. At the same time, EDAS Container 4.x version is just one of the commercial output forms of Dubbo3.0.
If your application is on EDAS or SAE, using the HSF + EDAS Container architecture, users only need to upgrade the container version to 4.x to easily upgrade the HSF application to the Dubbo 3.0 application. After the upgrade, HSF applications can continue to use the original development methods, and can also use the more complete service management functions provided by EDAS/SAE for Dubbo applications. At the same time, your HSF application will also have various new features of Dubbo 3.0, application-level service discovery, Triple protocol, etc.
Java microservice Proxyless Mesh architecture
In the heterogeneous microservice scenario, with the popularity of the ServiceMesh solution, how the original microservice application can communicate with other Mesh nodes in the Service Mesh microservice architecture and align its governance capabilities has become a problem that plagues users. The open source Spring Cloud / Dubbo framework can interoperate with the Mesh architecture without adding Envoy to the MSE microservice engine, and without modifying any line of code.
Large-scale production practice case of Dubbo3.0
In the process of Dubbo3.0 landing, we have many large-scale practices, such as koalas and Dingding.
Let's take Dingding as an example to introduce
background
In order to embrace containerization and enjoy the benefits of cloud, DingDing Document launched the cloud campaign in 2020. Currently, 50% of the traffic is running in public cloud clusters.
Business challenge
The document uploading to the cloud is divided into two stages.
In the first stage, there is a document cluster in the bomb (that is, the Alibaba group's internal network) and the cloud: the cluster in the bomb undertakes the stock business; the cluster on the cloud undertakes the incremental business. The in-bomb cluster also functions as an agent: for the upstream services in the bomb, the in-bomb cluster proxy calls to the document cloud cluster; for the cloud-based cluster, the in-bomb services proxy the dependencies within and downstream of the group.
In the second stage, the stock data is migrated to the cloud, and only the clusters on the cloud are retained. Upstream services and downstream dependencies are directly invoked through the triple protocol.
We are currently in the first stage.
In the first stage, we have several demands:
1. I hope to use a set of codes to run in two clusters in the bomb and on the cloud;
2. It is hoped that the cluster in the bomb will continue to use the HSF protocol;
3. Hope to use the open source RPC protocol on the cloud;
4. It is hoped that the clusters on the cloud and within the bomb can communicate with each other.
And Dubbo 3.0 perfectly meets our needs.
Landing plan
1. Dual cluster
The document currently has two clusters. The cluster in the bomb exposes the triple and hsf dual protocols, and the cluster on the cloud only exposes the triple protocol.
The version number in the bomb remains unchanged at 1.0.0, and the version number of 1.0.0.ZJK is used on the cloud.
For upstream services, there is only one cluster in the bomb, and all traffic goes to the cluster in the bomb. In this way, the upstream business does not need to be modified.
2. Unitized routing
The service inside the bomb intercepts incoming HSF requests. If it is resolved that the request needs to be routed to the cloud, a triple call is initiated to the cloud service. Otherwise, continue to hand over the request to the service in the bomb.
3. Downstream dependence
The document has some reliance on the service in the bomb, which cannot be removed. The current practice is that the document encapsulates the downstream services once and exposes the triple protocol for invocation on the cloud.
4. Service governance
After the service intercommunication is completed, it is time to look at how to conduct service governance. Including service query, service testing, service stress testing, service current limiting, service monitoring, etc.
4.1 MSE
Service query, service testing, service routing, etc. are all completed through access to MSE. Special mention should be made here of MSE's service test. Business students started testing on the http port of curl hsf on the machine, which was very troublesome, but after accessing the MSE service management, they can directly use the service test function of the MSE platform. Service testing is to provide users with a private network Postman on the cloud, allowing users to easily call their own services. Users do not need to perceive the complex network topology on the cloud, do not need to relate to the service agreement, do not need to build a test tool, and only need to implement the service call through the console. Support Dubbo 3.0 framework and the mainstream Triple protocol of Dubbo 3.0.
4.2 Other
Since the standard Dubbo protocol is used on the cloud, middleware such as Ahas and Arms can be seamlessly connected.
Summarize
With the help of the three-in-one dividend, Dingding Document has realized the rapid migration to the cloud within three months, and solved the problems encountered in the process of cloud migration through the productization of cloud products. Quick access and support to quickly complete the implementation of the service framework from intercommunication to governance.
tail
The self-developed, commercial, and open source “trinity” allows our core technologies deposited in Double 11 to be directly used by customers, omitting the process of depositing on the cloud and then exporting, reducing customers’ access to the same technology engine on Double 11 ”The threshold and cost can help customers quickly enter the digital native era. Dubbo3.0 is the choice under this strategy. Dubbo3.0 and HSF based on the Dubbo3.0 kernel are going hand in hand externally and internally to provide the best user experience for users on Alibaba Cloud, within the group, and open source, and participate together. To create the most stable service framework and lead the development of microservices in the cloud-native era.
Scan the QR code below to add a group (Dingdingsou group number 34754806) to watch this live broadcast playback, or move to the live broadcast room to watch:
https://yqh.aliyun.com/live/detail/26399
Alibaba Cloud MSE cloud product has integrated Dubbo microservice governance solution
Click the link ( https://www.aliyun.com/product/aliware/mse) to get started right away!
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。