Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: TiDB节点用阿里云的ALB做负载均衡支持吗?
I see that the official website recommends using Haproxy for load balancing. Does Alibaba Cloud’s ALB support load balancing?
Load balancing is not related to the TiDB cluster itself. Solutions like LVS, HAProxy, F5, A10, etc., can all be used, and ALB should also be applicable.
Sure, both hardware and software are fine.
It is recommended to use open source, as it is easier to locate issues when they arise.
If I understand correctly, ALB is a Layer 7 load balancer, and SLB is a Layer 4 load balancer. When I usually set up a proxy, whether it’s HAProxy or Nginx, I always configure it as a Layer 4 load balancer. In my understanding, a Layer 7 load balancer cannot proxy TCP requests and therefore cannot act as a proxy for TiDB.
The choice of load balancer is not particularly important; just distinguish the protocol and level of the proxy. Commercial load balancers are more stable and reliable than open-source ones, so just make the right choice.