25 Serverless Application Traffic Load Balancing and Routing Strategy Configuration Practices

25 Serverless Application Traffic Load Balancing and Routing Strategy Configuration Practices #

Traffic management from instance-oriented to application-oriented #

image.png

In the Serverless scenario, due to the elastic capabilities and the volatile nature of underlying computing instances, backend application instances need to be frequently brought up and taken down, making the traditional load balancing management methods used in ECS scenarios no longer applicable.

SAE provides users with application-oriented traffic management methods, eliminating the need to worry about elastic and deployment-related instance lifecycles. Users only need to configure the listeners and health check probes for their applications, leaving the complex instance-oriented configuration work to the SAE product.

Load balancing configuration for single applications #

image.png

For single applications, SAE supports exposing application services through public or private SLB instances. Currently, only the TCP protocol is supported. Considering the need for HTTPS transformation in traditional HTTP-based applications, SAE also supports configuring HTTPS listeners, allowing the HTTP server to provide HTTPS services without modification.

Public SLB is used for Internet client access and generates both instance specification fees and traffic fees. Private SLB is used for client access within the VPC and incurs only instance specification fees.

To enable SAE to accurately control the timing of instance lifecycles, users need to correctly configure probes during deployment to avoid any business losses.

Routing strategy configuration for multiple applications #

image.png

In practice, large and medium-sized enterprises often split their business into different applications or services. For example, they may separate login services, billing services, and other related parts into separate applications, which are independently developed and operated, and then exposed to users through a unified gateway service, giving users the experience of using a monolithic application.

SAE provides a gateway based on an SLB instance, which forwards traffic to different application instances based on domain names and HTTP paths, functionally comparable to mainstream Nginx gateways.

The public SLB instance-based gateway is used for Internet client access, and incurs both instance specification fees and traffic fees. The private SLB instance-based gateway is used for client access within the VPC and incurs only instance specification fees.

Self-built microservice gateway #

image.png

SAE does not provide built-in support for microservice gateways commonly seen in microservice scenarios. However, users can still freely deploy their self-built microservice gateway within SAE.

In practice, a microservice gateway can also be deployed as an application within SAE. The microservice gateway can redirect business traffic to instances that provide microservices based on user-defined configurations. The microservice gateway, as an application, can also expose services to the public and private networks through SLB instances.

Conclusion #

Whether it is a traditional single-application scenario, a split multi-application scenario, or the currently popular microservice scenario, SAE product provides a complete solution for traffic management and routing strategies. By relying on reliable cloud products to provide basic network infrastructure, SAE strives to reduce the user’s usage costs as much as possible. Users only need minimal learning costs to manage their traffic in a white screen manner on the SAE console or deploy their own gateway applications.

Practical demonstration #

Demonstration content (click to view reference documents):

Click the following link to watch the video lesson for the demonstration: https://developer.aliyun.com/lesson202619007