There is one data center - dc1. There is a business need to setup another data center - dc2 in another geography and there might be more in the future say dc3.

Within the data center dc1:

  • There are two web servers say WS1 and WS2. These two webservers do not share anything currently. There isnt any necessity foreseen to have more webservers within each dc.
  • dc1 also has a local load balancer which has been setup with session stickiness. So if a user say u1 lands on dc1 and if the load balancer decides to route his first request to WS1 then from there on all u1's requests will get routed to WS1.
  • Local load balancer and webservers are invisible to the user. Local load balancer listens to the traffic on a virtual ip which is assigned to the virtual cluster of webservers ws1 and ws2. Virtual ip is the ip to which the host name is resolved to in the DNS.
  • There are no client specific subdomains as of now instead there is a client specific url(context). ex: www.example.com/client1 and www.example.com/client2.

Given above when dc2 is onboarded I want to route the traffic between dc1 and dc2 based on the client. The options that I have found so far are.

  • Have client specific subdomains e.g. client1.example.com and client2.example.com and assign each of them with the virtual ip of the data center to which I want to route them.


  • Assign www.example.com and www1.example.com to first dc i.e. dc1 and assign www2.example.com to dc2. All requests will first get routed to dc1 where WS1 and WS2 will redirect the user to www1.example.com or www2.example.com based on whether the url ends with /client1 or /client2.

I need help in the following

  • If I setup a global load balancer between dc1 and dc2 do I have any alternative solutions. That is, can a global load balancer route the traffic based on the url ?
  • Are there drawbacks to subdomain based solutions compared to www1 solution? With www1 solution I am worried that it creates a dependency on dc1 atleast for the first request and the user will see that he is getting redirected to a different url.

Are you looking to manually distribute customers to each DC, or simply looking for an easy way to distribute the load? If the latter, geo-based load balancing usually gives you the best performance.

geo-based load balancers are almost always DNS based, which means that you won't have URL information at the point of the DNS lookup, and as such can't make a decision on it. However, I have seen schemes where the web server in one location, after examining the request, will send a 301 redirect to a service in another location if the requested object is better served from elsewhere.

As for geo-based load balancing, there are several DNS-as-a-service products out there; I'd recommend Dynect (http://dyn.com/dns/dynect-managed-dns/). They can do both the geolocation and site monitoring, pulling a dead VIP out of the DNS rotation in the event of an outage.

There are quite a few appliance-based solutions as well, such as F5's GTM and Citrix's Netscaler, but they'll cost much more than the cloud-based solutions.

The biggest drawback of DNS-based solutions is that some clients will not reliably refresh their DNS caches in the event of a failover. On the site I work on (which is a big site), we'll see clients hitting a deprecated VIP days to weeks after removing its IP from DNS. Fixes for this get pretty exotic, generally depending on using routing protocols to "move" the VIP from one site to another in addition to the DNS change.

  • +1 on the issue of clients/cache servers not honoring DNS TTL - it's getting more and more common. Too bad that the alternative is to get your own AS number and public IP block to counter it.. – pauska Jul 20 '13 at 3:14
  • Yes. I am looking at distributing customers across each DC hopefully such that if DC1 goes down all customers on DC2 would not be affected and vice-a-versa. Reasons are : 1) load on each of the servers is not expected to increase tremendously but 2) Availability and business continuity is important.Also what's your opinion on client specific subdomains. – sandeepkunkunuru Jul 22 '13 at 16:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.