Technical Architecture
Application Load Balancer ALB
ALB is a load balancing service dedicated to application layer load scenarios such as HTTP, HTTPS, based on Nginx, and can receive both intranet and extranet traffic. The architecture is as follows:
The ALB is deployed in a cluster. A single cluster has at least 4 servers (at least 2 servers for overseas clusters). Tenants share the underlying servers, but Docker is used for resource isolation and CPU isolation. The ALB can contain one VIP (Virtual IP) and multiple EIPs at the same time, and it adopts the Proxy mode (i.e., the Fullnat mode). After receiving a request from a client, the ALB converts the connection from the client to the ALB VIP (Virtual IP) or EIP into a connection from the ALB’s proxy IP to the actual IP of the Backend (service node). Therefore, the Backend (service node) cannot directly see the client IP and can only obtain it through X-Forwarded-For (HTTP mode). In addition, the node health check module is integrated into the ALB process, so there is no need for an additional node health check module.
The internal network traffic of the ALB achieves high availability by using ECMP + BGP. The ALB servers establish BGP connections with the upstream switch through Quagga. Multiple servers under the same cluster will initiate announcements of the same VIP (Virtual IP) to the upstream switch. In this way, the upstream switch will load balance the traffic to each server in the cluster according to the ECMP algorithm. When a server malfunctions, the BGP connection will be interrupted within three seconds, kicking the faulty server out of the cluster to ensure that the service can still operate normally.
When the traffic of the ALB enters from the public network, the traffic of the client access request proxy ALB enters the DezaiCloud POP point and then enters the UVER (DezaiCloud Virtual Edge Router). The UVER is a public network traffic calculation center independently developed by DezaiCloud. It can obtain the next-hop information of all EIPs from the business database. After diverting the traffic through BGP, it establishes a tunnel for the traffic of the EIPs and sends it to the corresponding next-hop. The EIP of an ALB will be distributed to all servers in the ALB cluster. Therefore, the UVER sends this part of the traffic to each server in the ALB cluster according to the consistent hashing algorithm.
In the ALB, the cluster health check module regularly detects the survival status of the servers. If a problem with a server is found, it will notify the UVER to remove the abnormal server, thus ensuring high availability. Similarly, the ALB cluster also achieves high availability across availability zones.