Operations 10 min read

Mastering Load Balancing: Principles, Types, and Practical Tips

This article explains how load balancing solves high‑traffic, high‑concurrency challenges by distributing requests across multiple servers, covering its core principles, vertical and horizontal scaling, various classification methods such as DNS, IP, link‑layer, and hybrid approaches, along with their advantages, drawbacks, and deployment recommendations.

ITFLY8 Architecture Home
ITFLY8 Architecture Home
ITFLY8 Architecture Home
Mastering Load Balancing: Principles, Types, and Practical Tips

Facing massive user traffic, high concurrency, and large data volumes requires high‑performance servers, databases, storage, and efficient programming languages (e.g., Go, Scala). When a single machine reaches its limits, business partitioning and distributed deployment become necessary to handle large‑scale website traffic.

Transitioning from a single‑machine site to a distributed architecture hinges on splitting services and deploying them across multiple machines, forming a large‑scale distributed system. While this solves centralization issues, each deployed service still faces single‑point‑of‑failure and unified entry‑point challenges; redundancy and load‑balancing devices address these problems.

Load balancing distributes workload or request traffic across multiple servers or components, providing high performance, fault tolerance, and horizontal scalability.

This is the first article in a series detailing load‑balancing concepts, classifications (DNS, HTTP, IP, link‑layer, hybrid), and principles.

Outline

Load‑balancing principles

DNS load balancing

HTTP load balancing

IP load balancing

Link‑layer load balancing

Hybrid load balancing

1. Load‑Balancing Principles

System expansion can be vertical (adding CPU, memory, disk to a single machine) or horizontal (adding more machines). Vertical scaling cannot meet the demands of large‑scale distributed systems, so horizontal scaling—adding multiple servers to share load—is employed, forming a typical cluster and load‑balancing architecture.

Application cluster: the same application deployed on multiple machines to form a processing cluster that receives requests from the load‑balancer.

Load‑balancer device: distributes incoming requests to one of the servers in the cluster based on a balancing algorithm.

Load balancing addresses:

1. Reducing concurrency pressure and increasing throughput.

2. Providing fault‑tolerance for high availability.

3. Enabling scalability by adding or removing servers.

4. Enhancing security through filtering, black‑/white‑lists, etc.

2. Load‑Balancing Classification

Based on implementation technology, load balancing can be categorized as DNS, HTTP, IP, link‑layer, and hybrid.

2.1 DNS Load Balancing

The earliest technique uses DNS resolution to distribute traffic. Multiple A records point to a cluster of servers, serving as a first‑level load balancer for large sites.

Advantages:

Simple to use; offloads balancing to DNS servers.

Performance boost by resolving to the nearest server address.

Disadvantages:

Poor availability due to DNS caching delays.

Limited scalability; control resides with the domain registrar.

Low maintainability; cannot reflect real‑time server status or support many algorithms.

Practice: Use DNS as the first level, pointing A records to internal load‑balancer IPs, then let the internal balancer distribute requests to actual web servers.

1.3 IP Load Balancing

Operates at the network layer by modifying the destination IP address of incoming packets.

The load‑balancer receives a packet, selects a real server based on an algorithm, rewrites the destination IP, and forwards it without involving user‑space processes. Responses are similarly rewritten before reaching the client.

Advantages:

(1) Kernel‑level processing yields better performance than application‑level distribution.

Disadvantages:

(2) All traffic passes through the balancer, making its network interface a potential bottleneck.

2.4 Link‑Layer Load Balancing

Modifies MAC addresses at the data‑link layer to distribute traffic.

Servers share a virtual IP that matches the balancer’s IP; only MAC addresses are altered, allowing direct routing (DR mode) where responses bypass the balancer, eliminating its bandwidth limitation.

Advantages: High performance.

Disadvantages: Complex configuration.

Practice: DR mode is widely used today.

2.5 Hybrid Load Balancing

Combines different load‑balancing methods across multiple server groups, selecting the most suitable technique for each group and then balancing among the groups as a whole, achieving optimal performance.

This approach is common in large internet companies, especially when a single balancer cannot handle massive connection volumes.

Example pattern 1 (static‑dynamic separation): reverse‑proxy cluster caches static resources while dynamic requests are forwarded to an application load balancer.

Example pattern 2 (dynamic‑only): all requests are routed through an application load balancer.

Hybrid configurations allow flexible combination of methods based on specific scenarios.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Distributed Systemsnetwork architecturehigh availabilityhorizontal scaling
ITFLY8 Architecture Home
Written by

ITFLY8 Architecture Home

ITFLY8 Architecture Home - focused on architecture knowledge sharing and exchange, covering project management and product design. Includes large-scale distributed website architecture (high performance, high availability, caching, message queues...), design patterns, architecture patterns, big data, project management (SCRUM, PMP, Prince2), product design, and more.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.