AWS just keeps on innovating. They have recently just announced the ability to load balance DNS queries based on the users latency to an EC2 region…say wha?

http://docs.amazonwebservices.com/Route53/latest/DeveloperGuide/CreatingLatencyRRSets.html

So if a user is based in Australia and you have an application or website running on an EC2 instance based in Singapore, you can create a DNS record so the users request is routed to the nearest instance to them. Similarly if you have an instance in the US a users DNS record can be directed to a US based instance in EC2.

The result is a user experience directed to the nearest EC2 region your application is running in. To test this, I created a version of our website http://www.cloudcomputingperth.com and created the necessary DNS entries. You can see by my nslookup output I am directed to the Singapore EC2 elastic IP whilst my DNS server is set to a local one, yet if I use a US based DNS server, I am directed to my US EC2 elastic IP.

C:\Users\Luke>nslookup http://www.cloudcomputingperth.com
Server: dns1.mydomain.local
Address: 172.20.0.1

Non-authoritative answer:
Name: http://www.cloudcomputingperth.com
Address: 122.248.243.93

C:\Users\Luke>ipconfig /flushdns

Windows IP Configuration

Successfully flushed the DNS Resolver Cache.

C:\Users\Luke>nslookup http://www.cloudcomputingperth.com
Server: 111.118.175.56.reverse.crucialx.net
Address: 111.118.175.56

Non-authoritative answer:
Name: http://www.cloudcomputingperth.com
Address: 184.169.151.178

Pretty damn cool, but does it actually work? Of course!

So I created 2 copies of the website and slightly changed the footer of the site for each region its hosted in.

Then accessed the URL from my machine with a local DNS server, then changed the DNS server to be a US based server.

Advertisements