5
I am raising knowledge for the creation of a multi-tenant system. I’ve been taking a look at some references from MSDN, SOEN and SOPT, as well as several websites.
Although I have read the references, even clarifying many doubts, there are still some issues that are not yet fully clear to me. So I decided to come here to see if I could shed some light.
In the references I read, the two models to work with multi-tenant that most caught my attention were:
Isolated systems
This approach has some advantages, such as the ease of creating code and not worrying so much about security issues. However, I believe it is an illusory facility, and, as said, only for the development of the application, because the maintenance of the system would become costly as the number of customers increased.
Using this approach would also allow the possibility of customizing or customizing the system for the specific needs of the customer. And this possibility is important for this system.
Shared system
This approach hampers the development of implementation in view of the fact that security needs to be better designed to prevent unauthorised access to data that do not belong to the tenant. However, the system maintenance would be reflected for all customers. But this is not necessarily a good thing, because some customer may not want to update their system.
To make customization on this template I planned to use MEF
to load dynamic plugins to extend system functionality to the tenant. And for the customization of the views I thought to use a structure like this: {tenant}/Views/...
. If there was no view in the client folder would use a default system view even.
A few more considerations
The tenant access the system and may have a linked website. Ex: by accessing the site www.meusite.com.br he can see the "result" of the information he added to the system. On this website the client of tenant can access a restricted area. Customers of tenant are divided into 2 profiles: To and B.
An example to clarify:
The tenants will own dealerships that can pick up used cars for consignment sale. The tenant adds the car in the system and soon it becomes visible on the website to the customer with the 'Customer' profile. This profile can have a 'wish list' for example. And the customer with 'Owner' profile can also access the site in a restricted area to see how are the issues related to your vehicle.
Explained the situation the remaining doubts are as follows:
- Using the isolated model the DBMS would be with many databases. What would be the possible implications of this?
- Using the shared model, the operations in the database would not have a loss of performance due to the filters needed to ensure access to only the data of the tenant?
- Still in the shared model, the increasing number of records in the table would be a further obstacle to performance?
- Regarding the scalability of an application with this structure, what could be done to avoid performance problems?
- It would be a good idea to use
MEF
to load extensions tocontrollers
for the purpose of adding functionalities? - It would be possible to make the tenant is redirected to the 'public' content of the system?
- How could you automate the creation of these tenants to reduce human interaction?
- It would also be possible to make custom mailboxes available for these tenants. Ex: [email protected].
Could you elaborate on the last three questions? It was unclear what "public" content would be, what you understand about automating tenant creation and your specific difficulty with email boxes.
– Dherik
This answer will get huge. It will take me a while to type everything.
– Leonel Sanches da Silva
@Dherik the public content is as in the example of the conceissionário. It has the administrative vision of the system and a view as a website, where it would be like a display of registered vehicles, with option of predefined filters. In relation to automation would be something like: The tenant makes the online payment and the creation of the database and the other information necessary for it to use the system are generated without the need for human interaction.
– Richard Dias