Tenants

  

Can anyone tell me about Tenant in details? What is tenant user and why we need them?


A Tenant is an "instance" of your application that uses isolated data. A typical OutSystems application runs on a single tenant and the developer doesn't need to know about Tenants. You can turn on "Multi-tenant" as an eSpace property, which is especially useful if you have a Software as a Service application, although there may be some other use cases.

I'll use the company I work for as an example for multi-tenant: we sell a gym management software; each gym is a tenant; all gyms use the same application, but they can't see data from other gyms. Users are included in that isolated data I mentioned; since a user belongs to a specific tenant, when they login, they can only see that tenant's data.

What the platform does behind the scenes, for multi-tenant scenarios, is to create a Tenant _ID column in every table and then create a VIEW for each tenant, based on an SQL statement like has a "SELECT * FROM MyEntity_123 WHERE MyEntity_123.Tenant_ID = 123". These views are automatically used in queries, instead of the original tables. The platform also allows timers to be scheduled for each tenant.

Hi Pradip.

Take a look at this page from the documentation and you'll get it.

Cheers,

GM

Good explanation João

What happen if you start with a entity as a no multi tenant , some record are inserted and after that you change this entity to be a multi tenant ?

So the records inserted before will not be available more,  right ? 

Hi Tiago,

Those records will be on Users tenant. This is a tenant that exists by default in Outsystems.

Regards,

Marcelo

If you inserted records into a table and then changed it to multitenant, the Tenant_ID columns on those records will be empty, so they won't appear in any query.