Monday, May 14, 2012

Create multiple Server Farms in one IIS ARR (Application Request Routing)

Most people use ARR to increase web applications' scalability and reliability by leveraging rule-based routing, load balancing, shared hosting and disk caching, etc. In my case, I found it a very good solution for medium sized corporations to expose their data via RESTful, OData or SOAP based web services if they already have the infrastructure in place and do not intend to go Cloud at the moment.

In our business scenario, there are a few implicit requirements:
  1. We should be able to use existing infrastructure without adding new hardware/servers.
  2. We should be able to expose all services using only one endpoint, which is the gateway. Furthermore, we expose the services as standard HTTP port 80 while the actual ports for our internal services are not disclosed.
  3. We must have the least number of holes in firewall for all services, ideally the number would be one.
  4. We should have a consistent and clean URL pattern for all services. For example: http://greatplace.org/Services/thisService?param1=x and http://greatplace.org/Services/thatService/, etc.
  5. We may also use this gateway to expose other resources than web services, e.g. reports.
  6. The server farms can support different authentications, e.g. reports farm does not allow anonymous access.
  7. The solution must be reliable and easy to maintain though load balancing and redundancy are not big concerns at present.
A simple practical design is like this:

For big enterprises, multiple ARRs can be utilised for routing specific types of requests to different server farms, for example one ARR for reporting server farm and one for general web services, etc. But what I am sharing here is how to use one ARR to dispatch requests to multiple server farms based on rule-based routing.

So first we create two server farms, add servers (and port mappings if any) in each farm:
Then we add the URL Rewrite rules

For the Reports Farm, we would like the original URL http://internal.server.ip:port/Reports/Pages/Report.aspx?ItemPath=SomePath to be routed to the servers in the reports farm with the exposed URL being http://external.server.ip/Reports/Pages/Report.aspx?ItemPath=SomePath, so the rule is like:

For the Services Farm, we would like the original URL, e.g. http://internal.server.ip:port/Services/Service1/Odata.svc/Products(5) to be routed to the servers in the services farm with the exposed URL being http://external.server.ip/Service1/Odata.svc/Products(5), so the rule is like:

And there we go. We can then configure the load balance and caching stuff as usual. It's awesome that ARR provides such great flexibility and capability in IIS.

Ref:
  1. ARR
  2. Using the URL Rewrite Module

12 comments:

Sequencing Server said...

Thanks. I've followed through to setting the 'Action', but I don't get an option for 'Route to Server Farm' even though I have 2 server farms configured.. I have options for rewrite, none, redirect, custom response and abort request.. Any ideas? Is this specific to Svr 2012/2012R2? Could it be because I'm using Svr 2008 R2?

Suseela Susiee said...



What an awesome post, I just read it from start to end. Learned something new after a long time.

datawarehousing training in Chennai

Abiya Carol said...


This blog is having the general information. Got a creative work and this is very different one.We have to develop our creativity mind.This blog helps for this. Thank you for this blog. This is very interesting and useful.

digital marketing course in chennai

jayashree said...

I read your blog you have applied some information only in this blog, please give some more information too. It will be helpful for me.

Best Dental Clinic In Vellore

Sowmiya said...

This blog is very much nice and very useful too, it makes me to improve my knowledge, so please latest kind of information.

Web Design Company in Chennai

deeksha said...

This blog is very well good, so it is very much impressive and it will be useful too to understand many more things.

Digital Marketing Company in Chennai

deeksha said...

I read your articles very excellent and the i agree our all points because all is very good information provided this through in the post.

Digital Marketing Company in Chennai

Deepika said...

I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.


Best Dental Clinic in Chennai | Best Dentists in Chennai | Dental Hospital in chennai

Sowmiya said...

I read your articles very excellent and the i agree our all points because all is very good information provided this through in the post.

Digital Marketing Company in Chennai

Sanjana sekar said...

Wonderful blog.. Thanks for sharing informative blog.. its very useful to me.. iOS App Development Company in Chennai

Abiya Carol said...

It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command.

Dotnet Training in Chennai

Mahalyasree said...

Great articles, first of all Thanks for writing such lovely Post! Earlier I thought that posts are the only most important thing on any blog. But here at Shoutmeloud I found how important other elements are for your blog.Keep update more posts..
Office Interiors in Chennai
Home Interior Decorators in Chennai