Software as a Service (SaaS) is a Software distribution model on which the data and associated files will be kept on the Main Server. Then it is possible to access the site using browser. By keeping the data and files on a centralized server, it only need to modify the files on a Single place and the changes will be reflected everywhere. Linked In, webex, Basecamp are examples of applications based on SaaS model. SaaS application is having the following architecture:
Tenant is the user or customer of the application. Usually SaaS uses Multi Tenant architecture that means, more than one user can use the same application. Single Tenant on which there is one user for the entire application.
While developing an application using SaaS model, we have to consider few important things. This includes the database design changes, coding changes, authentication of Tenant, User, Loading User specific Theme & Content, SOA etc.
Once request received on Tenant Server, the very first thing which needs to do is to authenticate the Tenant. For this, we need to check the Host Name with our Tenant Database. If the Authentication is success, then the system receive the Tenant ID from database. We need to store this Tenant ID somewhere which can be accessible always either in SESSION or similar places.
- Next steps is checking the User Authentication if needed. User may access the page with or without a role. For this, system uses Tenant ID.
- This contains a number of process.To get a result, it uses different independent components and achieve the result by using one or more of them together.
- It may contact with database during this time.
- In all cases, it carries the Tenant ID.
Keypoints which we need to consider while designing database are:
- Design database tables to feel it like a separate website
- Apply indexing
- Always keep Tenant ID in all tables for easy database management
Service Oriented Architecture (SOA)
Important points to consider here are:
- It need to split the functions as much as smaller independent components
- The state of each function does not interact with other
- Achieve each services with loosely coupled components
Multi Tenant Application needs option to change Theme by keeping the inner functionalities as same in some cases. The basic layout structure of a Multi Tenant SaaS application have three steps layouts.
- Wrapper: This is common for the whole application.
- Nested Layout: This contains the site specific details like logo, hard coded contents etc. We can use CMS (Content Management System) to change the Site Specific details.
- View: The actual content requested will be displayed through this page.