Background
Load balancer are the essential components when it comes to creating high available web applications. We have all used load balancers with traditional on premise servers where our application is running on N instances and a load balancer is sitting in front of these servers and distributing load to them based on some predefined algorithm and connection affinity settings.
Moving to the cloud, we need to understand how we can achieve the same load balancing using Azure components. Load balancing in cloud applications require much more thought that having a simple load balancer in front of some servers as we could have services hosted on PaaS, we could have services running on separate instances for separate tenants and we could also have applications running on multiple servers that are geographically distributed across the world.
For this reason itself, there are multiple components available in Azure for load balancing. Each of these components have a different purpose and we need to choose the right component for the scenario to be able to achieve the optimal application architecture.
Azure Load Balancing Solutions
There are mainly 3 load balancing components available in Azure.
- Azure Load balancer
- Azure Application gateway
- Azure traffic manager
Let’s start understanding each of these components one by one and try to understand when to use each component effectively.
Azure Load balancer
Azure Load Balancer is a Load Balancer in a more classical sense as it can be used balancing load for VMs in the same way we were using traditional load balancers with our on premise servers. Now since Azure load balancer is designed for cloud applications it can also be used to balance load to containers and PaaS applications along with VMs.
But this similarity with traditional load balancers ends here only mainly because the Azure load balancer actually works are Transport Layer (Layer 4 of OSI model). Which would mean that it will distribute the network traffic in the same Azure data center but will not be able to use the features that tradition load b