A multi-tenant web application is one that responds differently depending on how it is addressed – by the tenant.
This kind of architecture has become very popular, especially with Enterprise and SaaS products due to the fact that a single code base and deployment can serve many different tenants. Since all tenants use the same application, it’s easier for maintenance and upgrades.
It’s being adopted by providers like Salesforce , Office365, Slack and Basecamp. A single instance of a Multi-Tenant application handles multiple clients and Each “client” is called a “tenant.”
Every tenant interacts with the same code base. However application provides :
Your multi-tenant application must employ a way to identify a tenant and find out for which tenant is an HTTP request received for.
ASP.NET Zero is a web application development framework based on ASP.Net Core. (https://aspnetzero.com)
ASP.NET Zero framework supports and implements multi-tenancy. Let us look at how the application can identify tenants for storing data , and how to show tenant data depending on HTTP requests.
There can be different strategies for identifying and resolving tenants , like :
In order to provide a seamless login experience, your application should have Single entry point for all tenants.
This approach is more intuitive wherein it’s not necessary to remember the tenant URL. For example all tenants have a common login page with URL https://app.waiinsure.com .
A tenant user logs in with his organizational email address user1@tenant1.com or user1@tenant2.com.
Even if we do not know the tenant URL i.e. , https://tenant1.waiinsure.com , with a custom approach, The application code simply grabs the tenant name from the tenant username (organizational email address)and authenticates the user.
The it sends a request to the database. And if the database schemas is set up correctly, only that tenant specific data is retrieved and he is redirected to a tenant unique landing page. This is achieved with some customization in the Asp.net zero framework.
Common Login page https://app.waiinsure.com
Above figures show users of two different organizations logging in at the common login page and getting authenticated by Asp.Net zero application to view their company specific dashboard.
In order to implement this approach, the important consideration is tenant identification.
If you have any questions please write to me at kirti.kulkarni@waiin.com.