⚖️ Azure Load Balancing

📌 Overview

Load balancing refers to evenly distributing traffic (network load) across a group of backend resources or servers. Azure provides various load balancing services depending on the traffic type (Global vs Regional) and layer (Layer 4 vs Layer 7).


1. Regional Load Balancers (Traffic within a Region)

🧱 Azure Load Balancer (Layer 4)

Operates at the Transport Layer (TCP/UDP). It distributes traffic based on IP address and port number.

🌐 Azure Application Gateway (Layer 7)

Operates at the Application Layer (HTTP/HTTPS). It is a web traffic load balancer.


2. Global Load Balancers (Traffic across Regions)

🌍 Azure Traffic Manager

DNS-based traffic load balancer. It distributes traffic to services across global Azure regions.

🚪 Azure Front Door

A global, scalable entry-point that uses the Microsoft global edge network to create fast, secure, and widely scalable web applications.


3. Load Balancing Algorithms 🧮

A. Static Algorithms

These do not consider the real-time load or health of the server. They follow a fixed rule. Benefits: Simple, Less Overhead.

B. Dynamic Algorithms

These do consider the real-time status of the server (CPU, RAM, Active Connections).


4. High Availability Configurations 🛡️

Active-Active

                    +-----------------------+
                    |    Traffic Manager    |
       +------+ --> |        (DNS)          |
       | User |     +-----------------------+
       +------+          /             \
                        / (Traffic)     \ (Traffic)
                       v                 v
           +-----------------+     +-----------------+
           |    Region A     |     |    Region B     |
           |                 |     |                 |
           |  [Load Balancer]|     |  [Load Balancer]|
           |       |         |     |       |         |
           |       v         |     |       v         |
           |    [App A]      |     |    [App B]      |
           +-----------------+     +-----------------+
               (Active)                (Active)

Active-Passive (Failover)

                    +-----------------------+
                    |    Traffic Manager    |
       +------+ --> |        (DNS)          |
       | User |     +-----------------------+
       +------+          |             .
                         | (Active)    . (Standby)
                         v             .
           +-----------------+     + . . . . . . . . +
           |  Primary Region |     . Secondary Region.
           |                 |     .                 .
           |  [Load Balancer]|     .  [Load Balancer].
           |       |         |     .       |         .
           |       v         |     .       v         .
           |    [App A]      |     .    [App B]      .
           +-----------------+     + . . . . . . . . +
               (Active)                (Passive)

💡 Hinglish Explanation (Traffic Police)

1. Azure Load Balancer (Layer 4)

2. Application Gateway (Layer 7)

3. Traffic Manager (DNS)

4. Algorithms (Tareeka)

5. High Availability (Jugaad)


🆚 Selection Cheat Sheet

ServiceScopeLayerProtocolsBest For
Azure Load BalancerRegional4TCP/UDPNon-HTTP, High Performance, Internal DB traffic
Application GatewayRegional7HTTP/SWeb Apps, WAF protection, SSL Termination
Traffic ManagerGlobalDNSAnyDisaster Recovery routing, Simple Multi-region
Azure Front DoorGlobal7HTTP/SGlobal Microservices, Web App Acceleration

💡 Exam Tips for AZ-900

1. Load Balancing