Skip to main content

Redirecting Traffic Based On Priority Using Azure Traffic Manager

For any web application to work there has to be an associated end point, which means whenever users sends a request, endpoint is the first thing which gets hit. If I say in simple term, endpoint is an internet facing service which could be hosted either in Microsoft Azure or outside of Azure.

What is Azure Traffic Manager

Now what is Traffic Manager? As it’s name suggests, it manages the traffic. It distributes the traffic across various Azure regions along with health monitoring capabilities. So, if you are planning for a multi-region support with high availability, it could be a perfect service for you. 

Now, you must be thinking, what is the core which is making this happen? Actually it uses the DNS to route traffic to endpoints based on the selected Traffic Manger profile and the configured routing mechanisms. I’ll shortly mention about what all routing methods are available but before that let’s take a quick look at some of the major benefits which we can achieve using Traffic Manager. 

Benefits of using Azure Traffic Manager

  • Traffic Manager provides automatic failover whenever endpoint goes down as it keeps monitoring the end points.
  •  In case of planned maintenance activity, Traffic Manager redirects the traffic to other end points which are configured. So, we need not to worry about any downtime windows.
  • Traffic Manager has the ability to perform calculation to know which end point will provide lowest latency to the user. In a way, Traffic Manager improves the responsiveness by redirecting the traffic to such end points.
  • Another important capability of Traffic Manager is, it not only supports Azure end points, but it also go hand-in-hand with external non-Azure endpoints.
  • And lastly, Traffic Manager allows to combine multiple routing methods to achieve any complex business scenarios using nested profiling mechanism.

Ways to manage traffic

Currently, there are 6 ways once can manage DNS routing. 


Performance 

This method is useful, when endpoints are configured in different geographic locations and one wants to select the closet one, in terms of lowest network latency.


Weighted

In this method, one can create endpoints with designated weights, ranging between 1 and 1000 and based on the weight, traffic is redirected accordingly.


Geographical

This method route users based on the geo location or say, it works based on the geography their DNS query originates from. It may look similar to performance but actually it’s different. The best use case, I can think of is, let’s say due to some compliance and government regulations one wants all the traffic from EAST US to be redirected to WEST US endpoint. So, this can be achieved by selecting the geo based profile.


Priority

As it’s name says, it works on the basis of assigned priority. So, whichever endpoint is having higher priority, traffic would be redirected to that one. By any chance, if endpoint having highest priority is down or not healthy, request will automatically be redirected to the endpoint which is assigned as 2nd highest priority and it keeps going on. Such routing method is very useful in disaster recovery scenarios.


Multivalue

In this type of routing method, there exists multiple endpoints for a single client request. One caveat here is, one can not go with server name mappings and has to mandatorily go with IPv4 or IPv6 one. Unfortunately, I couldn’t find any real-time use case here.


Subnet

This method allows to map range of IP addresses to specific endpoints. Say, you want certain users or to be specific certain IP addresses to always use WEST US endpoint and rest all can use other end points then this routing method can be used.

Well enough of theory. Let’s have a look at practical example of how priority based DNS routing works in my pre-recorded video on my YouTube channel named Shweta Lodha.

Comments