Layer 4 vs Layer 7 Load Balancing: Choosing the Right Alibaba or Tencent Cloud Service
This guide explains the fundamental differences between Layer 4 (transport‑level) and Layer 7 (application‑level) load balancers, compares Alibaba Cloud and Tencent Cloud offerings across performance, features, and pricing, and provides practical selection tips and common pitfalls to avoid.
Layer 4 vs Layer 7 Load Balancing
Layer 4 load balancers work at the TCP/UDP transport layer and forward traffic solely based on IP address and port . They do not inspect the payload, which gives them very high throughput and low latency.
Layer 7 load balancers operate at the application layer (HTTP/HTTPS/QUIC). They make routing decisions using URL, domain, request headers and cookies , enabling fine‑grained request‑level routing, gray‑release, and security integration.
Key technical differences
Protocol layer : L4 – transport (TCP/UDP); L7 – application (HTTP/HTTPS/QUIC).
Forwarding basis : L4 – IP + port only; L7 – URL, domain, headers, cookies.
Core advantages : L4 – extremely high performance, millisecond latency, stateless forwarding; L7 – intelligent routing, support for canary releases, WAF integration.
Typical scenarios : L4 – game servers, high‑frequency trading, massive IoT connections; L7 – e‑commerce platforms, micro‑service architectures, front‑end/back‑end separation.
Simple analogy
L4 dispatcher receives 1.1.1.1:8080 and forwards directly to the backend listening on port 8080, regardless of request type.
L7 dispatcher receives https://example.com/product, parses the /product path and routes to the product service; /order goes to the order service, achieving request‑level routing.
Alibaba Cloud Load‑Balancing Product Matrix
Traditional Load Balancer (CLB) – supports both Layer 4 and Layer 7. Ideal for general‑purpose websites, mixed‑protocol migrations, and small‑to‑medium applications.
Application Load Balancer (ALB) – pure Layer 7. Provides URL/domain routing, canary release, WAF integration, and elastic scaling. Suited for micro‑services, e‑commerce, online education, and complex web apps.
Network Load Balancer (NLB) – pure Layer 4. Delivers extreme performance (up to 100 M PPS) and millisecond latency. Best for real‑time game battles, high‑frequency finance, and massive IoT connections.
Tencent Cloud Load‑Balancing Product Matrix
Application Load Balancer (ALB) – pure Layer 7. Supports HTTP/HTTPS/QUIC, URL rewrite, session persistence, and container‑friendly deployment. Targeted at micro‑services, e‑commerce, mini‑program back‑ends, and content routing.
Network Load Balancer (NLB) – pure Layer 4. Offers low latency, high throughput, static public IP, and strong burst handling. Used for game servers, financial payment systems, database proxies, and massive long‑connections.
Traditional Load Balancer (CLB) – Layer 4 + 7 basic offering, low cost, gradually being phased out. Suitable for legacy system migration and low‑traffic small apps.
Alibaba vs. Tencent: Core Product Comparison
7‑layer flagship : Both provide ALB. Alibaba’s ALB integrates tightly with its broader ecosystem; Tencent’s ALB is optimized for the WeChat mini‑program ecosystem.
4‑layer flagship : Both provide NLB with comparable performance. Choose based on regional latency and IP stability.
General‑purpose product : Alibaba’s CLB is more stable for generic scenarios; Tencent recommends migrating to ALB/NLB.
Billing model : Alibaba – ALB billed by LCU, NLB by performance capacity; Tencent – ALB billed by LCU, NLB by bandwidth/traffic. For small traffic the cost difference is minor; for large traffic the bandwidth‑based model may be cheaper on Tencent.
Common Selection Pitfalls
Misconception 1 : “7‑layer is always better, so pick it first.” – Incorrect. Layer 7 adds processing overhead; pure Layer 4 workloads (e.g., real‑time games) suffer higher latency. Select based on protocol requirements.
Misconception 2 : “ALB and NLB are identical because of the name.” – Incorrect. While core functions overlap, implementation details differ. Alibaba’s ALB integrates seamlessly with ACK containers; Tencent’s ALB is more friendly to the WeChat ecosystem.
Misconception 3 : “Choosing the correct layer guarantees success.” – Incorrect. You must also enable cross‑zone deployment, configure health checks properly, and avoid single‑point failures.
Conclusion
First determine whether your traffic needs transport‑level (Layer 4) or application‑level (Layer 7) forwarding. Then map that requirement to the appropriate cloud product – Alibaba CLB/ALB/NLB or Tencent ALB/NLB/CLB – while considering performance, ecosystem integration, and billing model. Avoid the three common misconceptions and configure high availability to ensure reliable service.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Xiao Liu Lab
An operations lab passionate about server tinkering 🔬 Sharing automation scripts, high-availability architecture, alert optimization, and incident reviews. Using technology to reduce overtime and experience to avoid major pitfalls. Follow me for easier, more reliable operations!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
