Host Bluemix application with the same URL on multiple regions

Bluemix now has multiple region (US and UK) to host applications. So user has choice of selecting regions depending on network connectivity. I was wondering that because Bluemix is based on open platform called Cloud Foundry, it should be able to support the same application on each Cloud Foundry instances via DNS round robin.

This is a preliminary experiment for hosting the same application on both region using the same URL. Bluemix can bring your own domain. For example, I can have “example.com” domain for my applications. I noticed that I can set up the same domain for each region in US and UK.

US

$cf domains
name             status
mybluemix.net    shared
ng.bluemix.net   shared
example.com      owned

UK

$cf domains
name                  status
eu-gb.mybluemix.net   shared
eu-gb.bluemix.net     shared
example.com           owned

I have setup DNS server locally, and setup it to do round robin for each host. For example, dnstest.example.com has IP address, and the same host has another IP address.

2014-12-08 15_33_19-dns server

And created an alias dnsapp for the host (dnstest). If I run “nslookup” command to search for dnsapp.example.com, it surely returns IP address via round robin.

 

$ nslookup dnsapp.example.com
 Name:    dnstest.example.com
 Addresses:  5.10.124.141  75.126.81.68
 Aliases:  dnsapp.example.com
$ nslookup dnsapp.example.com
 Name:    dnstest.example.com
 Addresses:  75.126.81.68  5.10.124.141
 Aliases:  dnsapp.example.com

Then, I pushed the same application with slight modification to show the region (i.e. US or UK).

# Push the application to US region
$cf login -a https://api.ng.bluemix.net
$cf push dnsapp -d example.com
# Push the application to UK region
$cf login -a https://api.eu-gb.bluemix.net
$cf push dnsapp -d example.com

The result was not that I expected one. I always got the same result. It seems either computer or browser seems to cache the IP address. So I need to bring two PCs. And open the http://dnsapp.example.com. Here is a result. I now see the same application with the same URL runs on both Bluemix regions.

2014-12-08 15_27_13-us region 2014-12-08 15_26_39-UK region

If this works, I think this can become yet another solution for redundancy. For example, we might get some disruption in the region due to security update (e.g. Shell Shock). But if we have the same application with the same URL in the different region, it is likely that the application will be able to serve to end-user without significant impact.

I also think this can be used on another Cloud Foundry instances, such as NTT’s Cloudn PaaS, Pivotal’s one, or your own. This means the same application with the same URL should be able to run on various Cloud Foundry instances. Our application scales beyond just one cloud vendor. This is the power of Cloud Foundry openness. By the way, this blog is still experimental state, but surely good to start about scalability beyond region.

Advertisements
This entry was posted in Bluemix. Bookmark the permalink.

3 Responses to Host Bluemix application with the same URL on multiple regions

  1. Renaud says:

    Did it work?
    As I am wondering if your approach worked to create a true multi region system based on Bluemix

    Thank you!
    Renaud

    • ibmamnt says:

      This works assuming that DNS can detect offline of one region (i.e. detect http 404). Our team is working on better solution (not available in English).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s