How to Implement Multitenancy when working with two databases

Hi,

I want to build a multitenant application in which i will be using same ui but data will be pulled from different databases for different users logging into the application. I am not clear how to implement this here in outsystems. 

Please help me with this.

Smriti
 

Hi Smrith, 


Before going to implementation, I would suggest to you checkout Outsystems Video and course and it will be helpful to build a multitenant application. 


 

Jitender Gaur wrote:

Hi Smrith, 


Before going to implementation, I would suggest to you checkout Outsystems Video and course and it will be helpful to build a multitenant application. 


 

Hi,

I have already checked it. 


I believe the first of your problems is to bind the platform to two different databases. 

The easier way may be to have  extensions that expose and standardize the "tenant" data bases and have a entity in the platform database that holds the information of which database extension to e use by each tenant.

Hope this idea helps you

Regards 

Graça  

Maria da Graça Peixoto wrote:

I believe the first of your problems is to bind the platform to two different databases. 

The easier way may be to have  extensions that expose and standardize the "tenant" data bases and have a entity in the platform database that holds the information of which database extension to e use by each tenant.

Hope this idea helps you

Regards 

Graça  

Hi Graca,

I have two extensions in my application which are mapped to two different databases. I want to retrieve data from these based on tenant ids. 

I am not sure how will we be able to map db extensions to tenant id. If you have any idea pls let me know.

Regards,

Smriti 

Hi Smriti! 

As site properties can be multi-tenant, you can have a site property that identifies for each tenant the extension to use.  Perhaps in a core eSpace that encapsulates all database accesses. 

Regards

Graça

Hello all,


The Platform has 2 site properties (TenantId and TenantName), you can do as Maria said, check the value of these site properties and use a if to call one extension or the other.


With the best regards,

Gonçalo

Gonçalo Oliveira wrote:

Hello all,


The Platform has 2 site properties (TenantId and TenantName), you can do as Maria said, check the value of these site properties and use a if to call one extension or the other.


With the best regards,

Gonçalo

Hi,

in this process, in order to switch between databases, i'll have to use if condition in preparation as well as in ui. is there a way to avoid if statements.


Smriti


Smriti Asthana wrote:

Gonçalo Oliveira wrote:

Hello all,


The Platform has 2 site properties (TenantId and TenantName), you can do as Maria said, check the value of these site properties and use a if to call one extension or the other.


With the best regards,

Gonçalo

Hi,

in this process, in order to switch between databases, i'll have to use if condition in preparation as well as in ui. is there a way to avoid if statements.


Smriti


Hello Smriti, 

Regarding the 'IFs' when you need to get the data from the DB i don't know any other way, regarding the UI what you can do is use structure and map the data you are retrieving to the structure, that you don't need to change the UI.


With the best regards,

Gonçalo