Last Update: Sep 04, 2024 | Published: May 02, 2018
In this article, I will explain the options you have for load balancing applications or services in Azure.
There are a few reasons for deploying a load balancer in Microsoft Azure and they aren’t always about load balancing, I’ll explain a few reasons here.
If you want high availability, then you will typically need more than one machine or maybe even many machines across data centers or even Azure regions! Load balancing allows stateless services, such as web servers, to be aggregated and presented to clients as a single unit; if one fails, the client is redirected to another that is still responding to a load balancer probe.
Tied into this is the ability to scale out services. The cloud is designed to add performance by adding more machines. If you need more RAM/CPU, add another machine. If the service is abstracted by a load balancer, then the new capacity is added/removed without the client needing to make any changes.
A load balancer can do other cool things too, including but not limited to:
Azure includes a load balancing service called the Load Balancer. This is a simple Layer-4 (TCP or UDP) service that can load balance services and is commonly used. A probe tests to see if the members of a backend pool are responsive; if so, traffic is directed to one of the running members. A simple client affinity method can be enabled (keep sending a shopper to the same web server) for client IP address or client IP address plus protocol.
One of the less obvious reasons for using the Azure Load Balancer is for creating NAT rules. If you next-next-next your way through creating an Azure virtual machine, then every machine gets it’s own public IP address. This is both wasteful, difficult to manage with scale, and creates multiple entry points, which increase security complexity. Instead, one can deploy a single public IP address with an Azure Load Balancer and create NAT rules for services such as RDP or SSH. This is much like one might do with an on-premises firewall.
There are two kinds of Azure Load Balancer. The free Basic tier load balancer is the one that you will use for simpler deployments that require no more than 100 backend endpoints, don’t need to span availability zones in a region, and have simple networking requirements.
The Standard tier load balancer adds scalability (up to 1000 backend endpoints), is supported for unifying services across availability zones, and offers more complex networking options. For example, HA Ports enables active/active scale-out and high availability for network virtualization appliances.
The other major difference between the Basic and Standard tiers is pricing. The Basic tier load balancer is free but the Standard tier load balancer has a complex consumption-based charge.
The WAG is Azure’s native Layer-7 load balancer. Being a Layer-7 solution, it brings application awareness to the table. A backend pool aggregates machines that are sharing the load of delivering a service. A probe optionally tests those machines to see if they are online or not. And a listener is created to accept HTTP or HTTPS traffic for a domain. You can have up to 16 of those listeners in a WAG. This means that a single WAG can handle many domains on a single public IP address, including SSL protected domains.
There are many features of the WAG:
There are three major differences to highlight with the Azure Load Balancer:
Microsoft load balancing options offer enough functionality for a large percentage of deployments. You might find yourself using a mix of the Azure Load Balancer and the WAG. But there are times when a third option will enter the mix or be your solution of choice. Third-party load balancers from the likes of Kemp, Citrix, and F5 (and more) are available in the Azure Marketplace, making them easy to deploy and supported in Azure. One can deploy these Linux virtual machines into a virtual network to add extra Layer-7 functionality that Microsoft doesn’t have. The funny bit about this is that you’ll probably deploy two of these load balancers and then probably need to deploy a Standard tier Azure Load Balancer (HA Ports) to unify these devices as a single load balancer to external clients.