We have developed a multi-tenant ASP.NET application. When a customer registers, they get their own subdomain to use for their site (e.g. tenant1.ourapp.com).

The process of setting up the customer's site needs to be configuration free.

Currently we have it set up like so:

  • 1 x Dedicated IP Address for Website
  • DNS A Record for *.ourapp.com to dedicated IP
  • Single website in IIS (7.5) handling all requests to dedicated IP

The rest is handled by our application (inspecting url and loading tenant specific config etc.).

The big question is how can this scale? Let's say that I wanted to only host 50 tenant instances per physical website in IIS. I now have the problem that the original site is handling all requests for ourapp.com (thanks to the wildcard dns record).

We're also looking at Azure so a solution that works for both a standalone server and Azure would be golden!


I would slightly alter your architecture:

Windows Azure comes with a load-balancer built-in. Install all your websites onto a single Webrole that can be spread across multiple instances. Configure your multi-tenant application to route the requests internally based upon the source/customer/url.

If you are truly multi-tenant, you will have a single code-base. The content that is seen by the user is dependent upon their context/user-id/etc. This way, you have one application, everyone shares the resources of your instances in a round-robin way, and no single server can stand in a way of failure.

Putting 50 sites on one server, another 50 sites on another server, etc.. is the "old" non-cloud way of dealing with things. Your server goes out, and 50 customers are down. And not have the agility/scalability when one of the customers becomes "too hot" for a single server.


In general with something like this if I understand your question correctly you would want to look into a load balancer to spread the load across multiple web servers. You would send all requests to the load balancer, and it would then forward the requests to your web servers.

You could do this in lots of ways, you could always send tenant1.ourapp.com to the same server, or you could spread that among all or a set of servers.

I am personally a fan of using HAProxy on Linux as a load balancer, there are also other software load balancers and hardware options.

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.