kryptonkal
kryptonkal

Reputation: 894

Multi level sub Domains for a Multi-tenant Application

A project I am working on was once an internal intranet application, but now it is being ported over to a multi-tenant internet application. Usually, when deploying any web applications, we would use the format http://webapp.company.com which has existed long before I joined. Since the project is now a multi tenant application, I am trying to decide between different architectures.

1) Using the client/tenant as part of the main host url

http://tenant.webapp.company.com

This approach requires additional ssl certificates and iis settings

2) Include the tenant as part of the routing and the tenant name will be included as a routing parameter

http://webapp.company.com/{tenant}/my/route/url/{param}

This approach, in my opinion, is 'messy' and I feel it is not the most-correct solution.

3) Keep the existing url of http://webapp.company.com and add specific bindings in IIS to point the requested url to the host location.

When the user enters the url http://tenant.company.com they will be served the application that resides at http://webapp.company.com The problem with this approach is that we may deploy additional applications and this is not scalable.

I am leaning towards approach number 1 as I have experience implementing it (without the extra domain). Is the 4th level domain ideal? Any ideas as to what approach is better than the other? Possibly a new approach? Any input is appreciated.

Upvotes: 0

Views: 3315

Answers (1)

NightOwl888
NightOwl888

Reputation: 56849

Using the client/tenant as part of the main host url

http://tenant.webapp.company.com

This approach requires additional ssl certificates and iis settings

Actually, you might be able to use a wildcard certificate for *.webapp.company.com, which would mean you can extend this scheme without additional IIS configuration.

In addition, this approach is the most elegant when it comes to routing. There is even a MVC-Subdomain-Routing project on GitHub that you can use for some direction (or as is if your requirements are met by the project).

Also see this question and this answer for some other approaches.

Upvotes: 2

Related Questions