Azure Load Balancing
Distribute network traffic efficiently and reliably across your applications.
Azure Load Balancer is a Layer 4 (TCP, UDP) load balancer that enables you to distribute network traffic to healthy virtual machines in a virtual network. It provides high availability and application scalability.
Key Concepts
What is Load Balancing?
Load balancing is the process of distributing incoming network traffic across a group of backend resources (like virtual machines or containers). This ensures that no single resource becomes overwhelmed, improving application responsiveness and availability.
Azure Load Balancer Tiers
Azure Load Balancer offers two tiers:
- Basic: Provides load balancing for applications. It is limited to a single availability zone.
- Standard: Offers enhanced capabilities, including zone redundancy, better performance, and support for Network Security Groups (NSGs) on the load balancer's frontend IP configuration.
Load Balancing Rules
Load balancing rules define how incoming traffic is directed to backend instances. You can configure rules for:
- Directing traffic: Map a frontend IP address and port to a backend IP address pool and port.
- Health probes: Define how the load balancer checks the health of backend instances.
- Session persistence: Control whether requests from the same client are directed to the same backend instance.
Health Probes
Health probes are crucial for the load balancer to determine which backend instances are healthy and can receive traffic. If an instance fails the health probe, the load balancer will stop sending traffic to it until it recovers.
Supported probe types include:
- TCP
- HTTP
- HTTPS
Use Cases
- Ensuring high availability for web applications.
- Scaling applications to handle varying loads.
- Distributing traffic for databases and other backend services.
- Implementing disaster recovery scenarios.
Types of Azure Load Balancers
Azure Load Balancer
The primary Azure Load Balancer service for Layer 4 traffic distribution. It can be used for both internal (private) and external (public) scenarios.
Azure Application Gateway
A Layer 7 (HTTP/HTTPS) load balancer that provides advanced features like SSL termination, cookie-based session affinity, Web Application Firewall (WAF), and URL-based routing.
Traffic Manager
A DNS-based traffic load balancer that allows you to distribute traffic to your services across different Azure regions or even external endpoints. It's ideal for global traffic distribution and disaster recovery.
Getting Started
To start using Azure Load Balancer, you typically need to:
- Create a Virtual Network and subnets.
- Deploy your backend virtual machines.
- Create an Azure Load Balancer resource.
- Configure a frontend IP configuration.
- Create backend address pools.
- Define load balancing rules.
- Configure health probes.