By Heqing Jiang
As another milestone project of Dubbo embracing cloud-native, Dubbo Mesh provides Dubbo users with a solution to upgrade to the Service Mesh architecture while continuing to provide production-level service governance and service control capabilities based on Dubbo's powerful scalable base.
This article describes the overall design principles, deployment architecture, and plug-in control mechanism of Dubbo Mesh.
Dubbo Mesh is connected to various ecosystems in a plug-in manner. Except for some architectures that maintain basic operation, most components support hot swapping and dynamic selection of deployment methods based on different deployment scenarios.
The design of plug-in capabilities continues Dubbo's consistent high scalability characteristics. Based on such a basic capability, developers can customize according to their deployment scenarios (such as accessing the internal self-built DevOps platform). The plug-in capability makes it easy for Dubbo Mesh to adapt to new basic components in the future. Through the hot swapping design, most of the new features will be smoothly implemented in the production environment, isolating the impact of middleware changes on business collaboration change.
In terms of architecture and deployment form, Dubbo Mesh is divided into a control plane and a data plane.
As the core of service governance, the control plane has an abstract and unified model. It is responsible for connecting with the underlying infrastructure and providing a unified governance portal from startup configuration, service discovery, and traffic management to authentication.
The data plane focuses on the business programming model and communication capabilities. It is connected to service governance capabilities based on multiple deployment modes (SDK, Sidecar, and Agent) and decoupled from the business code based on dynamic deployment capabilities.
In terms of overall component roles, there are two types of components in Dubbo Mesh: basic components and extensibility components.
Basic components provided by Dubbo are used to build the entire system (such as the Admin user control component, the Dynamic Binary Push distribution component (described in the following section), and the data proxy component).
Extensibility components are provided by Dubbo and other ecosystems to provide specific capabilities (such as the service test component) the Config dynamic modification component, and the Skywalking full-tracing analysis component in the preceding figure. Each extensibility component is designed to be hot pluggable and has the capability of optional dynamic switching sections.
In addition to the description of the deployment architecture, the preceding figure identifies the data stream direction under a deployment architecture (such as Dubbo Mesh).
Dubbo Mesh provides two communication modes: Proxy mode and Direct Connect mode. The Proxy in the basic component provides a channel to reach the data plane, which is an Any data flow that does not bind any upper-layer semantics. Extensibility components can communicate with each other through Proxy or directly with the data plane.
The Proxy mode does not require components to be aware of the connection mode of the cluster. It is suitable for some simple components without independent servers. Based on the capabilities of Dubbo, it can directly realize communication with the data plane, reducing the difficulty of managing connections. The direct connect mode is used to integrate some complex components that have independent servers. For example, full-tracing analysis components usually need to deploy centralized collection servers independently. If traffic is forwarded through Dubbo Proxy, the deployment cost will be increased to a certain extent.
The data plane planning of Dubbo Mesh is divided into Java Proxyless and Sidecar. Java Proxyless mode provides a high-performance deployment solution based on the dynamic loading capability of Java ClassLoader. Sidecar mode provides a common deployment solution across languages and architectures based on external process replacement.
The Java Proxyless mode is upgraded from the conventional Dubbo Java deployment mode. The dynamic loading mechanism based on Java ClassLoader avoids coupling specific implementation capabilities with business code and provides middleware hot upgrade capabilities by separating the Dubbo kernel from the implementation mode.
As shown in the preceding figure, the Dubbo SDK defines Dubbo extension points (such as Router, Registry, and LoadBalance). The extension points reuse the existing SPI mechanism of Dubbo as much as possible. In addition, the Dubbo SDK integrates a unified DubboInitializer, which pulls the required code during run time from the control plane and assembles it into a complete Dubbo SDK.
In the sidecar mode, Dubbo runs as an independent process and controls traffic using local communication methods (such as UDS, TCP, or request interception). The goal of traffic governance is achieved by performing data processing in sidecar processes and customizing traffic routing.
Similar to the Proxyless mode, the Sidecar mode provides extension points to support custom assembly implementation and dynamic replacement and upgrade in different scenarios. Sidecar provides universal governance capabilities across languages and architectures since it directly governs traffic and is not coupled to business code.
The preceding two data plane architectures involve the dynamic distribution capabilities of extension implementations. This section describes these capabilities in detail.
Extensions in the Java Proxyless mode are dynamically loaded using Java ClassLoader. Therefore, you only need to obtain the implementation class of the corresponding extension to implement loading. In Dubbo Mesh, a unified Dynamic Binary Push distribution component can deliver the corresponding class implementation of each plug-in to the data plane for loading.
In the Sidecar mode, multiple methods are available to enable hot-swapping. In this example, the process is replaced. Sidecar code is dynamically assembled and compiled in the control plane. Then, the Dynamic Binary Push distribution component distributes the Sidecar binary package to the Dubbo agent in the data plane. The Dubbo agent starts a new process and switches traffic to the new process.
Analysis of the Metrics Function of the Dubbo Observability Practice
376 posts | 41 followersFollow
Alibaba Cloud Native - October 9, 2021
Alibaba Developer - August 24, 2021
Alibaba Cloud Native - September 8, 2022
Alibaba Developer - December 30, 2021
Alibaba Container Service - March 10, 2020
Alibaba Developer - July 20, 2021
376 posts | 41 followersFollow
Alibaba Cloud Service Mesh (ASM) is a fully managed service mesh platform that is compatible with Istio.Learn More
Accelerate and secure the development, deployment, and management of containerized applications cost-effectively.Learn More
Customized infrastructure to ensure high availability, scalability and high-performanceLearn More
A one-stop, cloud-native platform that allows financial enterprises to develop and maintain highly available applications that use a distributed architecture.Learn More
More Posts by Alibaba Cloud Native Community