Introduction: Dubbo 3.0 is born under the background of cloud native. The microservices built with Dubbo follow the idea of cloud native. It can better reuse the underlying cloud native infrastructure and fit the cloud native microservice architecture.

Dubbo3.0 introduction

The author | ten sleeps

Since The open source of Apache Dubbo in 2011, Dubbo has gained a lot of experience from many large-scale Internet and IT companies after years of practice. Dubbo has gained great recognition in the past due to its advantages such as user-friendly To Java, rich functions and strong governance ability. It has become one of the popular mainstream RPC frameworks at home and abroad.

However, with the advent of Cloud native era, new requirements have been put forward for Java microservice governance system represented by Apache Dubbo and Spring Cloud, including the expectation that applications can be started faster, the protocol penetration of application communication can be higher, and the support for multiple languages can be more friendly. Spring, for example, released its Graalvm-based Spring Native Beta solution this year, with millisecond startup capabilities, higher processing performance, and more.

This background poses two major requirements for the next generation of Apache Dubbo:

1. Keep the benefits that already exist out of the box and in a practical context, which is what many developers want;

2. Follow the cloud-native idea as much as possible to better reuse the underlying cloud-native infrastructure and fit the cloud-native microservice architecture.

Dubbo 3.0 was born under the background of cloud native. The microservices built with Dubbo follow the idea of cloud native, which can better reuse the underlying cloud native infrastructure and fit the cloud native microservice architecture. This is reflected in:

  • Services can be deployed on containers and Kubernetes platforms, and the service life cycle can be aligned with the platform scheduling cycle.
  • Proxyless Mesh architecture is introduced to further simplify the cost of Mesh landing and migration and provide more flexible options.
  • As a bridge layer, it supports intercommunication with heterogeneous micro-service systems such as SpringCloud and gRPC.

Under the background of cloud native, Apache Dubbo 3.0 chooses to fully embrace cloud native, upgrades the Dubbo architecture, and puts forward a new service discovery model, the next generation RPC protocol and the adaptation of cloud native infrastructure.

Dubbo3.0 commercial version

Let me first introduce three cloud products related to microservice governance on Ali Cloud: EDAS, MSE and SAE.

  • EDAS

Ali Cloud aPaaS products, one-stop deployment and release platform, at the same time, it is an aircraft carrier, with micro-service governance, monitoring, pressure measurement, limiting flow degradation and a series of capabilities, it is also an AIOps platform.

EDAS 3.0, as the preferred online business application hosting platform in the cloud of distributed architecture and digital transformation, provides intelligent and automated solutions for user applications in multiple dimensions such as micro-service governance, application release and change, and intelligent operation and maintenance.

“At the PaaS level, we have always embraced open source technology and remained time-compliant with community releases; In terms of enterprise features, such as service governance and application monitoring, we provide a stable and mature product to lower the threshold for enterprises to build Internet applications, such as enterprise application service EDAS 3.0 is such a typical product.

— Jiang Jiangwei, alibaba Partner and senior researcher of Alibaba Cloud Intelligent Basic Products Division

  • MSE

Micro Service Engine (MSE) is a one-stop micro-service platform for the mainstream open source micro-service ecosystem in the industry, helping users of micro-service to use open source micro-service technology to build a micro-service system in a more stable, more convenient and lower cost manner. Provides registry, configuration center full hosting (Nacos/ZooKeeper/Eureka compatible), Gateway (Zuul/Kong/Spring Cloud Gateway compatible) and non-invasive open source enhanced service governance capabilities.

  • SAE

The Serverless Application Engine (SAE) is the first application-oriented Serverless PaaS to provide a more cost-effective and efficient one-stop application hosting solution. Support Spring Cloud/Dubbo/HSF application zero transformation on the Cloud, providing monitoring and diagnosis, automatic image building, Java full link acceleration, multi-release strategy, second level automatic resilience and other capabilities, support Jenkins/ Cloud efficiency/plug-in deployment applications. You can also deploy any language using the Docker image.

These three Cloud products have all the service governance capabilities out of the box, supporting all the open source Dubbo and Spring Cloud frameworks on the market in the last five years, including Dubbo 3.0; All of the following capabilities are available right out of the box without modifying a single line of code or configuration. You just need to plug your Dubbo 3.0 application into EDAS/MSE/SAE.

1. Complete service Contract details

Service contracts are the raw material for all functionality in the governance process. When testing to verify its availability, you need to know the method the service provides and automatically populate the template based on the method parameters to test; When configuring traffic rules, you need to know the parameters of the method so that you can configure traffic rules based on traffic characteristics. When configuring service degradation and service authentication, you need to configure different degradation and authentication policies for different methods with different parameters or return values based on the method name and parameter type.

The open source Swagger does a better job, but MSE’s service contracts are simpler and more efficient. Open source Swagger just needs to introduce dependencies, configure @API annotations at coding time, and then launch a Swagger Server to see the details. The only downside is that it doesn’t include Dubbo.

In order for the user to use it without modifying any code configuration, older versions of the application code and images should also be supported. Because if development is needed, iteration efficiency will be affected due to the intrusion, we still choose the Agent scheme. In this way, we can see the details of the microservice in the MSE console without modifying any code and configuration, and only need to connect the application to the One Agent.

Of course, if the app itself is already Swagger loaded, we’ll be able to get good compatibility support. Finally, we can take a brief look at the effect of service contracts, which already support both Spring Cloud and Dubbo applications.

  • You can see in detail what services your application is registered for and who the consumers of those services are.
  • You can view all the microservice methods provided by your application in detail;
  • You can view the return values and parameters of all methods provided by the application in detail.
  • Services such as service testing, service degradation, and service authentication can directly obtain service contract data for subsequent governance rule configuration.

2. Full-link traffic control

In the microservice scenario, the traffic wants to accurately hit the grayscale version of an application on the whole link, and the traffic wants to control the complete and accurate flow of the whole link in accordance with the expected flow, currently open source does not provide such capabilities. However, we often encounter the following scenarios, resulting in we have to face the demand of full link traffic control.

How to achieve project/test environment isolation?

We start by creating new project environments, giving each project environment a unique project label. Traffic with this item tag is routed to the item environment, otherwise it goes to the trunk environment. The benefit of project environment isolation is that each developer can have his or her own project environment, preventing developers from interacting with each other during development.

How to achieve full link grayscale?

We first divide the grayscale machine, then deploy the grayscale version for all the applications on line, the grayscale flow goes into the grayscale version, and the normal flow goes into the production version. Gray version only for gray flow verification, effectively reduce the risk. When we want to gray release N applications, we need to do gray flow routing between the gray versions of the N applications.

The figure below nicely illustrates the ability to use flow control to allow our development students to deploy their own applications in both Development environment 1 and development environment 2 to achieve environment isolation and full link grayscale.

But without this mechanism of full-link traffic control, the logical or physical isolation of various development/grayscale/production environments requires the deployment of N complete sets of microservice architectures, which is very costly.

It can be seen that the full-link traffic control scheme in the figure above is a more reasonable deployment scheme design. We provide the ability of full-link traffic control out of the box. The following takes a single scenario in the e-commerce architecture as an example to introduce the full-link traffic control function.

After customers place an order, the traffic comes in from the entry application (or micro-service gateway) and calls the trading center, which then calls the commodity center, and the commodity center calls the downstream inventory center. The trading center and the Commodity Center each have two new versions (1 and 2) in operation, and grayscale verification is required for these two new versions. At this point, the inbound application (or microservice gateway) is expected to route the request traffic that meets the specific flow control rules to the new version, and the rest of the traffic is all routed to the online (official) version.

We only need to create the following full link traffic control rules in the EDAS console:

At the same time, we also provide flow control monitoring market, you can real-time view the QPS indicators of each application, to confirm whether the flow trend is in line with expectations.

3. Label routing

EDAS/MSE Service Governance provides traffic control capabilities for label routing. Each POD/ECS can be tagged, the tag is identified and displayed on the console, and then we can set ratios and content rules for the tag.

You can set the traffic ratio of each label:

You can also click traffic rules to set the content traffic rules of each label:

If there is a full link request. The “transparent or not” switch can be used to transparently transmit labels.

4. Out-of-the-box service testing

Service testing is to provide users with a private network, Postman, on the cloud, allowing users to easily invoke their own services. Users do not need to be aware of the complex network topology on the cloud, do not need to establish service protocols, and do not need to build self-testing tools. They only need to invoke services through the console. Support for the Dubbo 3.0 framework, as well as the mainstream Dubbo 3.0 Triple protocol.

5. Removal of outliers

In the microservice architecture, when the application instance of the service provider is abnormal, the service consumer cannot perceive it in time, which will affect the normal invocation of the service, and then affect the service performance and even availability of the consumer.

In the example scenario above, the system consists of four applications, A, B, C, and D, where application A calls applications B, C, and D, respectively. When some instances of APPLICATION B, C or D are abnormal (in the figure, there are 1 and 2 exception instances of application B, C and D respectively), if application A is not aware of it, some calls will fail. If the business code is not written gracefully, it may affect the performance of application A and even the availability of the entire system.

Here, I will focus on outlier removal. What is an outlier instance? Intermittent single machine jitter (high load, short CPU response, full thread pool, etc.) occurs in a microservice cluster. Due to the jitter of these individual nodes, the service quality of the whole cluster deteriorates. This happens all the time in the cloud, especially for big customers, where this ability is extremely important. In order to improve business stability, we need an automated solution that can automatically remove outliers when they appear, and then put them back into the cluster when they are healthy again.

In a word: provides business single point exception self-healing capability.

We just need to select the framework type and application, and then configure the minimum error rate allowed.

6. Service authentication

In contrast to the open source Dubbo 3.0, MSE provides out-of-the-box service authentication capabilities to protect your sensitive business and accurately control the permissions of service calls.

When our business develops, our services will also meet the requirements of permission control. For example, an application in the coupon department includes both coupon query interface and coupon issuing interface. For coupon query interface, all applications within the company have the permission to call by default; But only certain applications in customer service and operations have access to the coupon distribution interface.

As shown in the following figure, MSE users can manage the rights of their own services. This section uses Dubbo as an example. Application released cartservice com. Alibabacloud. Hipstershop. Cartservice addItemToCart method, only allow frontend calls the application.

Precise rights management enables you to better manage the rights of microservice calls, ensure business compliance, and ensure data security.

Service Mock

In contrast to the open source Dubbo 3.0 service mocking capability, MSE provides a complete solution out of the box.

When you encounter a peak business and find that the downstream service provider is experiencing performance bottlenecks or even affecting the business. You can use service mocks to degrade services, degrade some of the service consumers, return the Mock results without real invocation by the non-important business parties, and reserve the valuable downstream service provider resources for the important business callers, thus improving the stability of the overall service.

Open source existing Sentinel, Hystrix and other open source circuit breaker downgrades, mainly for unstable weakly dependent service calls, temporarily cut off unstable calls, to avoid local instability caused by the overall avalanche. As a means to protect itself, circuit breaker degradation is usually configured on the service consumer side.

Service degradation can be enabled both when service invocations report errors and when service invocations are normal, thus protecting service providers and allocating limited resources to key service consumers.

In the process of development, we believe that all of us have been to the situation that the development progress is blocked due to the slow development progress of the downstream dependency. After using the microservice governance Mock function, we can Mock a fixed return value, so that the development process does not need to depend on the progress of the downstream dependency. You also have the flexibility to change the Mock rules in the console to achieve rapid development.

As shown in the figure below, when an application is connected to MSE, you can provide the functionality of service mocks in the console in the following manner.

8. Service monitoring

For Dubbo application online monitoring and diagnosis capabilities are essential, we provide the following complete and out-of-the-box application monitoring capabilities to make application operation and maintenance easy and efficient.

  • Application details

  • Collect statistics on application dependent services and application instances/status codes

  • Application system information and slow call count monitoring

  • Statistical analysis of application data

  • Call topology analysis of the application

summary

EDAS/MSE/SAE Service Governance Center is the commercial version of Dubbo Admin, but more than that, we provide a one-stop solution for complete microservice governance capabilities by enhancing all versions of frameworks like Dubbo/Spring Cloud in the market in a non-intrusive way.

Not only the Dubbo3.0

At the same time, EDAS/MSE/SAE service governance also brings some of the best design and capabilities of Dubbo 3.0 to Dubbo 2.x and the Spring Cloud framework through non-intrusive service governance capabilities.

1. Microservices are aligned with the K8s life cycle

If microservices do not implement interfaces, errors that affect services may occur during application capacity reduction, expansion, restart, and release of new versions when the deployment architecture is K8s. Therefore, you need to configure health check for microservices in the K8s environment.

Just getting a health check isn’t enough: There are many possible reasons for this:

1. Application offline process: The application provider receives kill signal normally, the provider stops after processing the in-route request, the registry perceives the provider offline, the consumer receives the offline notification, and the consumer refreshes the call list. All these processes may cause errors and delays.

2. Problems may occur during the application launch process: Pod health check ready, Dubbo not ready for heavy traffic, initial request failed due to database /Redis connection, JVM class load lock causing slow start, health check write problem causing no healthy node in rolling publish, etc.

In the above stages, there may be problems, which need to be solved and guaranteed. This can be solved one by one in an open source way, such as adjusting the configuration of the registry, adjusting the configuration of the connection pool, adjusting the image packaging file, writing your own code to implement the logic that requests are processed en route, and so on. You can also use the MSE solution. You only need to access the MSE once without modifying the code. The access process takes 5 minutes.

Readiness to check

MSE will provide a Readiness interface that will return status of 200 when the microservice is fully ready to start, and 503 otherwise.

Liveness check

The MSE provides a Liveness interface that returns status 200 if the microservice is ready and the service status is healthy, or 503 if it is not.

We just need to configure the relevant configuration on the interface provided by K8s.

2, lossless up and down line

If your application does not have the lossless downline capability, services may be temporarily unavailable during the release of any of your applications, and a large number of I/O errors may be reported during the service monitoring in a short period of time. If your business does not do a good job of transactions, then data inconsistency can also occur and you need to manually correct the wrong data as a matter of urgency. After each release, you need to announce the shutdown. Otherwise, your users will be unavailable for a period of time, which will affect their product experience.

For any online application, how to ensure that the business is not aware during the process of service update and deployment is a problem developers must solve. That is, the normal business requests should not be affected during the phase from application stop to service restart and recovery. At present, no open source framework can solve this problem well.

When your application accesses MSE/EDAS/SAE, it automatically enhances the lossless down-line capability of Dubbo and Spring Cloud traffic in a non-invasive manner. The micro-service governance Center integrates the lossless downline capability in the life cycle of K8S. When the application in ACK cluster is deployed, rolled back, and scaled down, the effect of lossless downline will be automatically realized.

3. Concurrent service registration and subscription

By default, Dubbo service registration/subscription is executed serial. If there are too many services in your Dubbo application, the process will become very long, affecting the startup time of the application and causing certain stability risks. For faster app startup, MSE will enhance your microservices framework in a non-invasive way by adding a single switch to enable concurrent service registration and subscription, greatly reducing app startup time.

conclusion

Apache Dubbo 3.0.0 is a milestone release donated to Apache and represents a node in Apache Dubbo’s full embrace of cloud native.

EDAS/MSE/SAE service governance capabilities are also being enhanced with the development of cloud-native microservices and the evolution of Dubbo. As customers move to the cloud on a large scale, the pain points of some cloud-native microservices continue to surface. We are committed to enhancing non-invasive microservice governance. In the process of solving customers’ pain points, customers’ business on the cloud is always online, which makes it easier to upgrade the architecture of cloud native microservices.

The original link

This article is ali Cloud original content, shall not be reproduced without permission.