Introduction: the service framework, like the railway track, is the basis of interoperability. Only by solving the interoperability of service framework, it is possible to complete higher-level business interoperability. Therefore, it is an inevitable trend to unify with the same standards, integrate the two into one and build a new generation of service framework. Dubbo3. 0 is dubbo2 0 is integrated with HSF. It is the only standard service framework for Ali’s economic dignity to internal business, commercialization and open source.
The service framework, like the railway track, is the basis of interoperability. Only by solving the interoperability of service framework, it is possible to complete higher-level business interoperability. Therefore, it is an inevitable trend to unify with the same standards, integrate them into one and build a new generation of service framework.
Dubbo3. 0 is dubbo2 0 is integrated with HSF. It is the only standard service framework for Ali’s economic dignity to internal business, commercialization and open source.
Selection and practice of Alibaba Service Framework
Dubbo and HSF’s practice in Alibaba
Dubbo and HSF are both micro service RPC frameworks currently used by Alibaba.
Dubbo has quickly become a popular micro service framework product in the industry since it was opened in 2011, and is widely used at home and abroad. Dubbo project was born in 2008. At first, it was only used in an Alibaba internal system; In 2011, Alibaba B2B decided to open source the whole project, and it took only one year to harvest a large number of users from different industries; In 2014, due to the internal team adjustment, Dubbo suspended the update; In September 2017, Dubbo 3.0 restarted open source and graduated from Apache incubation in May 2019, becoming the second project donated by Alibaba to Apache graduation.
HSF is more widely used in Alibaba, undertaking the internal architecture evolution from single application to micro service, and supporting the smooth operation of Alibaba on the double 11 over the years; Since the release of the first version 1.1 in May 2008, after several years of iteration, HSF has gradually evolved from a basic RPC framework to an easily extensible microservice framework that supports 100 billion level calls per day. In the internal scenario, users can select a small number of configurations to easily access the micro service system and obtain high-performance and stable service calls. HSF can also be expanded according to its own business requirements to enhance the ability to obtain the whole link.
For the needs within the group, stability and performance are the core. Therefore, HSF, which has been tested in the high concurrency scenario of e-commerce, was selected as the core of the new generation service framework. Subsequently, HSF launched version 2.0, and reconstructed and transformed the main problems of the previous version of HSF, reducing the maintenance cost and further improving the stability and performance. HSF2. 0 solves the framework extensibility problems of opaque communication protocol support and opaque serialization protocol support. Based on Hsf2 0, and the group has also played in and out of multi language clients such as CPP / nodejs / PHP. Because HSF is also compatible with Dubbo’s protocol, the original Dubbo users can smoothly migrate to the new version. Therefore, HSF was fully launched in the group soon after its launch, with hundreds of thousands of deployed servers. It has basically completed the unification of Alibaba’s internal micro service framework and has been verified by the traffic peak of double 11:00 for many years.
Challenges and opportunities of next generation microservices
However, with the development of business and the iteration of the framework itself, the simple compatibility of the two frameworks from the protocol layer can not meet the needs. With the continuous development of cloud computing and the wide spread of cloud original physiological ideas, the development of micro services has the following trends:
K8s has become a de facto standard for resource scheduling. Since its proposal and development, service mesh has been gradually accepted by more and more users. Shielding the underlying infrastructure has become a core evolution goal of software architecture. The problems faced by Alibaba and other enterprise users have changed from whether to go to the cloud to how to smoothly and stably migrate to the cloud at low cost.
Due to the diversity of cloud paths and the existence of the transition state from the existing architecture to the cloud native architecture, the facilities for deploying applications are flexible, and the micro services on the cloud also show a diversified trend. Cross language, cross vendor and cross environment calls will inevitably give birth to a unified protocol and framework based on open standards to meet the needs of interoperability.
The end-to-end access to background services is growing explosively, and the scale of applications and the whole micro service system are growing.
These trends also bring new challenges to HSF and Dubbo.
Challenges for HSF and Dubbo
Microservice framework is a basic component. Most companies need to use a framework when they select a model in the early stage or when their business develops 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 stage. For Alibaba cloud, this brings a problem: the HSF framework is used internally, while most users on the cloud use the open source Dubbo framework. There are differences between the two frameworks in protocol, internal module abstraction, programming interface and function support.
How to make the best practices and cutting-edge technologies of Alibaba Group’s internal components using HSF more simply and directly output to the cloud is a problem that every student doing technology commercialization will encounter and must solve. In fact, we have also made some explorations. HSF framework was first promoted by cloud microservices. When closed source components are output on the cloud, many users have no way to troubleshoot problems. The whole service framework is a black box component for them. We found that this is not a good product direction. When outputting on the cloud, we must choose to embrace open source and advocate Dubbo and spring cloud frameworks.
At the same time, there are many problems caused by HSF and Dubbo frameworks in the group. How to integrate the technology stack of the original department or company into the existing technology system faster is an inseparable problem. A typical example is the koala who joined Alibaba in 2019. Koalas have always used Dubbo as a micro service framework and built large-scale micro service applications based on Dubbo. The migration cost is high and the risk is high. The Infrastructure Department of group and koala needs a long time to conduct pre migration research and plan design, so as to make sure that it changes again after basically feasible. From batch grayscale on-line to final full volume on-line. This blood exchange change not only requires a lot of manpower, but also 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, HSF framework is compatible with Dubbo protocol layer and API layer. However, this compatibility is limited to interoperability. With the development of Dubbo open source community for many years, this basic compatibility has great disadvantages in disaster recovery, performance and iteratibility. At the same time, it is difficult to align Dubbo’s service governance system. There are also risks in terms of stability, and they are unable to enjoy the technological dividends of the group’s technological development and Dubbo community evolution.
The root cause of these problems is that closed source HSF can not 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 become more and more intense with the continuous development of open source and cloud. The earlier this problem is solved, the lower the cost of cloud native migration for Alibaba and external enterprise users, and the greater the value it will generate.
Therefore, the integration of HSF and Dubbo is the general trend. In order to better serve internal and external users and better develop the two frameworks, Dubbo 3 0 and dubbo3 0 is the hsf3.0 kernel adapted to the infrastructure ecology within the group 0 came into being.
The final choice of service framework under the Trinity strategy Dubbo 3 0
Dubbo3. On the premise that the original feature set is fully compatible with the API, 0 also has the following new features facing the challenges of cloud nativity
- Dubbo 3.0 supports a new service discovery model. Dubbo 3.0 tries to start with the application model, optimize the storage structure, and design the original mainstream model of Qiyun to avoid interoperability problems caused by the model. The new model is highly compressed in data organization, which can effectively improve the performance and scalability of the cluster.
- Dubbo 3.0 proposed the next generation RPC Protocol – Triple. This is an open new protocol designed based on HTTP / 2 and fully compatible with grpc protocol. Because it is designed based on HTTP / 2, it has high gateway friendliness and penetration; Fully compatible with grpc protocol is natural and has advantages in multilingual interworking.
- Dubbo 3.0 focuses on cloud native traffic management, proposes a set of unified governance rules that can cover traditional SDK deployment, service mesh deployment, VM virtual machine deployment, container container deployment and other scenarios, supports one rule to govern most scenarios, greatly reduces the cost of traffic governance, and makes global traffic governance possible under heterogeneous systems.
- Dubbo 3.0 will provide solutions for accessing service mesh. For mesh scenarios, Dubbo 3.0 proposes two access modes. One is the thin SDK mode. The deployment model is exactly the same as the current mainstream deployment scenario of service mesh, while Dubbo will slim down, shield the same governance functions as mesh, and only retain the core RPC capabilities; The second is the proxyless mode. Dubbo will take over the responsibilities of sidecar, actively communicate with the control surface, and apply the cloud native traffic management function based on the unified management rules of Dubbo 3.0.
Evolution of service framework in Alibaba cloud commercialization
For the microservice framework, there are still great challenges to commercialize due to the business code associated with customers.
First of all, in terms of migration cost, we hope to reduce the migration cost to 0. At first, we sold the HSF + EDAs container architecture on the cloud. Therefore, when customers go to the cloud, they have to transform their business code. In addition, because the code is not open source, troubleshooting is also a headache. Later, We found that most microservice frameworks of customers choose open source Dubbo / spring cloud, but customers have their own registry. If they want to go to the cloud, they also need to migrate their registry to the MSE registry. This process requires users to transform the code. Generally speaking, double registration scheme is adopted. On the cloud, we find that we promote customers to do code transformation, Including the upgrade of SDK is a very difficult thing. The Dubbo version of many customers still stays at the version of 4-5 years. It not only needs attention from R & D, testing and operation and maintenance, but also needs scheduling support. This action will consume a lot of human resources and face many stability challenges. This step alone will block many customers. In order to solve the problem of customer SDK upgrade, we were wondering if we could not migrate the registry. It is best to deploy to the cloud without changing a line of code, but we need to provide the same service governance capability. Therefore, we proposed a bytecode enhancement technology based on Java agent, Help users use cloud products without changing a line of code, and provide customers with cloud products that can be up and down at any time without binding, so that customers can feel at ease. At the same time, we also provide a hosted registration center with more powerful surface operation and maintenance.
For the choice of microservice framework in commercialization, 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 several major pain points of microservice governance under the customer’s cloud native, mainly including lossless uplink and downlink, label routing, service authentication, outlier instance removal, full link gray scale, etc. through Java agent technology, we have solved the above problems without changing the code, Through customer communication, collect requirements, fall into products, and verify the demo to customers. This model runs through a positive cycle and is constantly enriching functions. In addition to Java agent, for multi language scenarios, we use service mesh, wasm and other technologies to also support customers to have consistent service governance capabilities and experience in Java applications without modifying a line of code.
At the same time, we have also made some attempts and choices in the selection of Java agents. At the beginning, we used the Java agent developed by closed source, and each cloud product has a corresponding Java agent, which will lead to problems such as too many Java agents and agent conflicts. At the same time, the Java agent maintained by ourselves is closed source. After stepping through some pits, we decided to use the Arthas one agent to reconstruct the agent of the service governance system and synthesize 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 follows this direction through Dubbo 3 0 + Java agent continuously and continuously outputs the technical dividends of the group’s technology development, Dubbo community evolution and commercialization practice to customers on the cloud.
Service governance seamlessly supports Dubbo 3 0
There are three solutions related to micro service governance on Alibaba cloud: MSE (micro service engine, the ability to provide micro service governance), EDAs (application platform hosted throughout the life cycle), SAE (serverless application platform with elastic scalability). Both EDAs and SAE deeply integrate MSE service governance capabilities; All service governance capabilities of MSE are out of the box and support all open source Dubbo and spring cloud frameworks on the market in recent five years, including Dubbo 3.0. You don’t need to modify a line of code and configuration. You just need to connect your Dubbo 3.0 application to EDAs / MSE / SAE. Including the lossless online and offline capability during the release of microservices, aligning the life cycle of microservices and k8s pod; Label routing capability weakens the binding dependence on IP, service authentication, outlier instance removal, full link gray scale, service mock, service monitoring, service contract, etc.
How to seamlessly upgrade an HSF application to Dubbo 3.0 application
Trinity is a unified technical system adopted by Alibaba for “self research”, “open source” and “commercialization”. In this technical direction, Dubbo 3 The design and implementation of HSF / Dubbo has realized the technical unity of HSF / Dubbo, and is also rapidly promoting the implementation within the group. At the same time, EDAs container 4 X version, which is Dubbo 3 One of the commercial output forms of 0.
If your application is on EDAs or SAE and uses the HSF + EDAs container architecture, users only need to upgrade the container version to 4 X can easily upgrade HSF applications to Dubbo 3.0 applications. After the upgrade, the HSF application can follow the original development mode, and can also use the more perfect service governance function provided by EDAs / SAE for Dubbo application. 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 servicemesh solutions, how the original microservice application interacts with other mesh nodes and aligns its governance capabilities in the service mesh microservice architecture has become a problem perplexing users. The open source spring cloud / Dubbo framework can interoperate with the mesh architecture without adding envoy on the MSE microservice engine and modifying any line of code.
Dubbo3. Mass production practice case of 0
Dubbo3. 0 in the process of landing, we have many large-scale practices, such as koalas, nails, etc.
Take nail as an example
In order to embrace containerization and enjoy the benefits on the cloud, nail document launched the cloud campaign in 2020. At present, 50% of the traffic is in public clusters.
The cloud of documents is divided into two stages.
The first stage, There is a document cluster in the bomb (that is, the network within Alibaba Group) and on the cloud respectively: the bomb cluster undertakes stock business; the cloud cluster undertakes incremental business. The bomb cluster also acts as an agent: for the upstream services in the bomb, the bomb cluster acts as an agent for the call to the document cloud cluster; for the cloud cluster, the bomb service acts as an agent for the downstream dependence in the group.
Phase I: there is a cluster in the bomb and on the cloud
In the second stage, the stock data is migrated to the cloud and only cloud clusters are retained. Upstream services and downstream dependencies are called directly through the triple protocol.
Phase 2: only one cloud cluster
At present, we are in the first stage.
In the first stage, we have several demands:
1. I hope to use a set of code to run in two clusters: in the bomb and on the cloud;
2. It is hoped that the intra missile cluster will continue to use the HSF protocol;
3. Hope to use open source RPC Protocol on the cloud;
4. It is hoped that clusters on the cloud and in the bomb can communicate with each other.
Dubbo 3.0 perfectly meets our needs.
1. Double cluster
The document currently has two clusters. The intra missile cluster exposes the triple and HSF dual protocols, while the cloud cluster only exposes the triple protocol.
The version number in the bomb remains 1.0 0 remains unchanged, and 1.0 is used on the cloud Version number of 0.zjk.
For upstream services, there is only one cluster in the bomb, and all traffic reaches the cluster in the bomb. In this way, the upstream business does not need any transformation.
2. Cellular routing
In bomb service to intercept 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 give the request to the service in the bomb.
3. Downstream dependence
The document has some dependencies on in bomb services, which cannot be removed. The current approach is to encapsulate the downstream services by the document itself and expose the triple protocol for invocation on the cloud.
4. Service governance
After the completion of service interworking, we begin to see how to conduct service governance. Including service query, service test, service pressure test, service current limit, service monitoring, etc.
Service query, service test and service routing are all completed by accessing MSE. The service test of MSE should be mentioned here. Business students initially test on the HTTP port of the local curl HSF, which is very troublesome. However, 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 cloud network postman, so that users can easily call their own services. Users do not need to perceive the complex network topology on the cloud, do not need the protocol of relational service, and do not need to build their own test tools. They only need to call the service through the console. Support Dubbo 3.0 framework and the mainstream triple protocol of Dubbo 3.0.
Because the standard Dubbo protocol is used on the cloud, middleware such as AHAS and arms can be accessed seamlessly.
With the help of Trinity bonus, nailing documents can be quickly launched into the cloud within three months, and the problems encountered in the process of launching into the cloud are solved through cloud product standardization. With the help of Dubbo 3 0, as well as the rapid access and support of MSE service governance capabilities, quickly complete the implementation of the service framework from interoperability to governance.
The “Trinity” of self-developed, commercial and open source enables our core technologies precipitated in the double 11 to be directly used by customers, omits the process of precipitation and re output on the cloud, reduces the threshold and cost for customers to obtain the “double 11 same technology engine”, and can help customers quickly enter the digital original era. Dubbo3. 0 is the choice under this strategy, Dubbo 3 0 and based on Dubbo 3 HSF of 0 kernel is going hand in hand externally and internally to provide the best user experience for Alibaba cloud, intra group and open source users, participate together to create the most stable service framework and lead the development of micro services in the cloud native era.
This article is the original content of Alibaba cloud and cannot be reproduced without permission.