26 Spring Cloud Dubbo Applications Seamless Migration to Serverless Architecture

26 Spring CloudDubbo Applications Seamless Migration to Serverless Architecture #

Background #

image.png

After studying the previous lessons, I believe you have a certain understanding of the SAE (Serverless App Engine) platform. SAE is a Serverless application hosting product built on top of IaaS resources. It eliminates many complex operations and maintenance tasks for customers, and provides turnkey solutions with pay-as-you-go pricing. Additionally, it provides rich Open API integration capabilities with other platforms.

This article will introduce some of SAE’s capabilities in the microservices field. SAE combines Serverless technology and microservices very well, providing native support for hosting and service governance of Java microservices. It allows Spring Cloud/Dubbo microservices applications to be migrated to SAE without modifying the code, only by modifying the configuration and dependencies. It also provides service governance capabilities such as tenant-based microservice isolation environment, service listing, seamless offline, out-of-band removal, application monitoring, and call chain analysis.

This course is divided into three parts. It introduces the advantages of migrating microservices applications to SAE, how to migrate Spring Cloud/Dubbo applications to SAE, and demonstrates the practical migration of Spring Cloud applications.

Advantages of Migrating to SAE #

image.png

Before discussing the migration process, let’s first introduce the advantages of migrating Spring Cloud/Dubbo applications to SAE:

  • Built-in Registry Center: All users share the registry center component, which saves users from deployment and maintenance costs. During the process of service registration and discovery, SAE performs link encryption, so there is no need to worry about unauthorized service discovery.
  • Service Governance: SAE has the concept of namespaces, which are logically isolated environments based on microservices tenants. Users can use different namespaces to isolate the registration, discovery, and invocation of microservices, and provide service governance capabilities such as seamless offline, out-of-band removal, and flow control degradation.
  • Application Monitoring: SAE provides monitoring capabilities for microservices applications, including host monitoring, exception stack analysis, and distributed call chain analysis. This enhances the observability and diagnostic capabilities of microservices applications.
  • Zero-code Modification: Simple integration enables a hands-free operational experience.

Spring Cloud/Dubbo Migration Solution #

So how do we migrate Spring Cloud/Dubbo applications to SAE? We only need to modify and add dependencies and configurations to deploy the application to SAE.

image.png

For Dubbo applications, you need to add the dependencies for dubbo-register-nacos and nacos-client. For Spring Cloud applications, you only need to add the dependency for spring-cloud-starter-alibaba-nacos-discovery.

Migration Demonstration of Spring Cloud/Dubbo Applications #

Spring Cloud provides a series of standards and specifications to simplify application development.

The currently popular implementations of Spring Cloud include Spring Cloud Netflix, Spring Cloud Consul, Spring Cloud Gateway, and Spring Cloud Alibaba.

If you are familiar with service registration components in Spring Cloud such as Eureka, Consul, and ZooKeeper, but have not used Nacos Discovery, the service registration component of Spring Cloud Alibaba, you only need to replace the service dependency relationships and service configurations of the registration component with Spring Cloud Alibaba Nacos Discovery without modifying any code.

Spring Cloud Alibaba Nacos Discovery also implements the standard interface and specifications of Spring Cloud Registry, which is similar to the way you previously used Spring Cloud for service registration and discovery.

image.png

Next, I will demonstrate the migration process for Spring Cloud applications. Please click the video course at https://developer.aliyun.com/lesson*2026*19003 to watch the demonstration.