Recently, there was a question posted on MSDN Forums regarding “Load balancing between two Logic Apps exposed as service”. I’ve provided some insights to the differences between Azure Traffic Manager and Azure Load Balancer, in this article, I’ll go slightly deeper to what exactly are the differences and when to use them.
Azure Traffic Manager
Azure Traffic Manager is a cloud load balancing that aims to improve app performance by automatically load balancing incoming traffic across datacenters. It allows you to control the distribution of user traffic for service endpoints in different datacenters. Service endpoints supported by Traffic Manager include Azure VMs, Web Apps, and cloud services. You can also use Traffic Manager with external, non-Azure endpoints. Traffic Manager operates at a DNS level.
Essentially, if you have an application that is hosted in various regions in Azure and you would like to improve availability and maximum global performance, Traffic Manager serves as a distribution mean to distribute client traffic to the closest available endpoint. There are various routing methods of approach to distribute your clients.
There are four traffic routing methods available in Traffic Manager:
- Priority: Select Priority when you want to use a primary service endpoint for all traffic, and provide backups in case the primary or the backup endpoints are unavailable.
- Weighted: Select Weighted when you want to distribute traffic across a set of endpoints, either evenly or according to weights, which you define.
- Performance: Select Performance when you have endpoints in different geographic locations and you want end users to use the “closest” endpoint in terms of the lowest network latency.
- Geographic: Select Geographic so that users are directed to specific endpoints (Azure, External, or Nested) based on which geographic location their DNS query originates from. This empowers Traffic Manager customers to enable scenarios where knowing a user’s geographic region and routing them based on that is important. Examples include complying with data sovereignty mandates, localization of content & user experience and measuring traffic from different regions.
This is a quick overview how clients connect using Traffic Manager.
Azure Load Balancer
Azure Load Balancer delivers high availability and network performance to your applications. It is a Layer 4 (TCP, UDP) load balancer that distributes incoming traffic among healthy instances of services defined in a load-balanced set.
The load balancer load balance incoming traffic to the virtual machines. You could configure to load balance traffic between virtual machines in a virtual network, between virtual machines in cloud services, or between on-premises computers and virtual machines in a cross-premises virtual network. This configuration is known as internal load balancing.
Internet Load Balancer
Internet Load Balancer maps the public IP address and port number of incoming traffic to the private IP address and port number of the virtual machine and vice versa for the response traffic from the virtual machine. Load balancing rules allow you to distribute specific types of traffic between multiple virtual machines or services. For example, you can spread the load of web request traffic across multiple web servers or web roles.
Internal Load Balancer
Unlike the internet load balancer, the internal load balancer (ILB) directs traffic only to resources inside the cloud service or using VPN to access the Azure infrastructure. This enables internal line of business (LOB) applications to run in Azure and be accessed from within the cloud or from resources on-premises.
Can Traffic Manager coexist with Azure Load Balancer?
Yes, absolutely! They can coexist. It is definitely ideal to use both Traffic Manager and Load Balancer together. With our earlier understanding, Azure Traffic Manager is a global load balancer (eg. DNS load balancing) and Azure Load Balancer is a local load balancer. Hence, it will be a good strategy to architect your cloud solution to load balance using both Traffic Manager and Load Balancer of your VMs or cloud applications.
When should I use Traffic Manager?
Ideally, since it’s a global load balancer, and unless you have high global client traffic, you wouldn’t be using Traffic Manager. For situations where you have deployed your web applications to multiple regions and want to route traffic of your clients to the closest available endpoint together with the designed routing method, your application will improve in high availability and maximum global performance.
One of the most important questions that have been asked a couple of times, and I’ve personally tested it out myself.
Can I configure my CDN endpoint as an external endpoint in Traffic Manager?
This question is legit and reasonable of its own. The question is, why do architects or even developers think of this approach? Why was this question raised so many times? Why should I even be concern?
- MSDN - How to use Azure CDN as endpoint for Traffic Manager
- StackOverflow - Can I point an Azure CDN at an Azure Traffic Manager
The answer to that is pretty straightforward. If I have my web application hosted in 3 different regions, (eg. EU, US, ASIA), and on top of that configured CDN endpoints to these applications. I would want traffic manager to distribute my CDN endpoint as the priority target endpoint. As we have mentioned in the earlier articles that CDN accelerates global delivery of static content, and one of the top reasons many chose to do so is because if the servers go down for some reasons, the load balancer will still be able to distribute the content via Azure CDN Endpoints instead. Any downtime wouldn’t have affected high traffic or volume of customers visiting the application.
Now, answering the earlier question, configuring CDN endpoint as an external endpoint in Traffic Manager doesn’t work. To why did it not work, I have no answer to that, however, if you manage to get that working, please do let me know.