azure traffic manager vs azure load balancer

Azure Traffic Manager Vs Azure Load Balancer Differences

Many engineers at some point may need to decide when to use azure traffic manager vs azure load balancer. Designing high availability for web applications is very important. Any amount of downtime can result in significant amounts of money lost for a business.

With the cloud rapidly growing in adoption, the ability to build high availability has become more available at a lower cost. Certain load balancers have different use cases so in this article we will talk about the differences between using an azure traffic manger vs azure load balancer.

What is a load balancer

Load balancers help distribute traffic across multiple web servers evenly. They help keep applications up and running in the event one web server goes down for maintenance or other reasons. This picture below shows and example of 3 web servers being served http traffic from a user who visits letmetechyou.com

Load balanced web site

This gives this website the ability to lose 2 web servers before the site is completely down. There are 2 main types of load balancers many engineers deal with. Layer 4 or Layer 7 load balancers. Before we get into azure traffic manager vs azure load balancer, lets talk about the different load balance layers.

What is a layer 4 Load balancer

The routing decisions made by Layer 4 load balancing are based on TCP & UDP data defined at the L-4 networking transport layer. In addition to performing Network Address Translation (NAT) on the request packet, The layer 4 load balancer switches the target IP address from its own to that of the chosen server during the NAT procedure, selecting a content server on the internal network.

What is a layer 7 load balancer

At the application level, Layer 7 load balancing makes judgments based on the actual content of each communication utilizing protocols like HTTP and SMTP. Layer 7 load balancers terminate network traffic, executes necessary decryption, analyses messages, and decides on content-based routing to open new TCP connection to the appropriate upstream server.

What is Azure Traffic Manager

Azure traffic manager is a Layer 7 dns based load balancer that helps distribute traffic globally across all azure regions. Depending on the type of routing method used for the traffic manager, clients will get sent to the appropriate endpoint. Traffic manager also provides resiliency in the event an entire azure region goes down.

Endpoints that azure traffic manager sends traffic to can live inside or outside of azure. Traffic manager gives you the ability to:

  • Monitor endpoints providing automatic failover if an endpoint goes down
  • Provides low latency connections to datacenters and applications all across the world
  • The ability to have 0 down time maintenance windows
  • Support Hybrid environments as companies slowly adopt the cloud

How Azure Traffic Manager Works

Traffic manager uses dns to direct clients to specific endpoints depending on the traffic routing rules. If taking our example picture above, we take 3 web servers and place them as endpoints behind traffic manager. The dns names of each server must be a cname under the root domain. Traffic manager only allow cnames to be created by the root domain under certain circumstances.

For example take app.letmetechyou.com. When a client requests that dns name, dns points to letmetechyou.trafficmanager.net. Traffic manager will then point to one of the endpoints. , providing the ip address and dns name back to the client.

Setting up an azure traffic manager

First you need to create an azure traffic manager profile. The important part is making sure you choose a unique dns name no other person could be using and also the preferred routing method.

Next you then need to setup your profile configuration which consist of the following settings:

  • There are 6 different routing methods to choose from depending on various factors pertaining to your endpoints
  • The DNS ttl interval determines how long clients will cache and reach out to the traffic manger for updated information
  • Endpoint monitor settings allows you to choose how traffic manager will monitor your endpoints. This must be setup the same way for each endpoint
  • The status code allows you to choose how your endpoints will respond to successful connections
  • Then the probing interval, tolerated number of failures and probe timeout gives you the ability to determine how endpoint failover will occur.

Next you need to configure an endpoint that azure traffic manager will point to. That can be either external, internal or nested. Traffic manager then has many other logging and alerts you can configure to make sure you can analyze problems that can arise with your connections.

How Azure Load Balancer Works

An azure load balancer is a layer 4 load balancer that divides incoming traffic among active virtual machine instances. To map traffic to available servers, it by default employs a 5-tuple hash (source IP, source port, destination IP, destination port, protocol type).

Load balancers can be internal, where they are only available through a virtual network, or internet-facing, where they are reachable via public IP addresses. Network Address Translation (NAT) is another feature that Azure load balancers provide for directing traffic between public and private IP addresses.

azure load balancer
azure load balancer

Reasons to use an azure load balancer

Azure load balancers provide inbound and outbound scenarios that give you low latency and high throughput. Azure load balancer is an azure managed services that can be utilized for the following scenarios:

  • Needing the ability to load balance internal and external traffic
  • Configure outbound connectivity for azure virtual machines to remove the need for vm’s needing an IP address
  • Monitor resources using health probes to detect up and down resources
  • Access virtual machines using port forwarding.

Although there are other reasons to use an azure load balancer these are some of the most common scenarios.

Choosing between Azure traffic manager or Azure load balancer

When deploying resources in azure, deciding to use traffic manager, a load balancer, or both can depend on certain scenarios. For example if your looking to load balance traffic within a single region then an azure load balancer.

If looking to route traffic to instances in multiple regions across azure whether internal or external to azure, then traffic manager may be a good choice. There may also be a time when you could need to utilize both an azure load balance and traffic manager.

Lets say you had multiple instances across different regions for example 2 servers in the west region and 2. servers in the east region. Traffic manager could route the traffic closest to the end user based off its dns request. This can all be managed in the traffic profile depending on the routing method chosen.

azure traffic manager & azure load balancer
azure traffic manager & azure load balancer

Comments are closed.