How to structure  a BIG MULTI-INSTANCE application ?

How to structure  a BIG MULTI-INSTANCE application ?

We are just starting the migration of our client/server application to Agile platform, and have some doubts on how to organize it.
The application has several modules, with a lot of functionalities, so at a first glance we thought of grouping these functionalities into several eSpaces. Users frequently navigate from one module into another, so we should use “single sign-on” in order to avoid users to login on each eSpace.
We have a lot of customers who use this whole application, so it should be “multi-tenant”.
Well, when we tried to implement this scenario, we found out that it would not be possible, because “multi-tenant” and “single sign-on” are mutually exclusive features.
What would be the best approach to address our needs ?
I refer here to the documentation about muti-tenant eSpaces, because I don't think being multi tenant, in the Outsystems context, means what it actually sounds like:

fter reading that, do you still need your application to be multi-tenant?
Yes, João, it really must be multi-tenant.

Our customers are companies who use our application, and each one should have their own data, one customer should not be able to “see” other customers data.

Hi Ricardo.

It seems to me you have something of a dillemma on your hands. Since they are mutually exclusive, you will have to implement something by hand, either the multi-tenancy simulation aspect, or the single-sign-on aspect.

If you decide to implement the multi-tenancy, on every entity and database access, you would have to use something that would make sure that only the data for a specific customer would be accessed and handled. Depending on how much data is common (for instance, category tables are usually common), and how much data must be separate, this might become harder to maintain in the long run. I would suggest encapsulating the database accesses to methods which require the customerId, so that when you bring on new developers, they do not run into mistakes of showing/writing data without it being related to a specific customer.

On the other hand, if you decide to implement single-sign-on, that would probably only result in you changing the EnterpriseManager solution, and make sure that, in the future, when you update it, you keep your own changes. I'm not sure how this would work, but this option might seem to be the best one to start off.

Have you thought of other alternatives?


Paulo Tavares
Hi all,

Regarding this same issue, one of the options for multi-tenant (specially when having tight security requirements) is to have separate databases for each one of the tenants (obviously this is only an option when we do not have thousands+ of tenants, which is assumed right now), while having a single application instance serving all of them. This instance would have the job of deciding which database to connect depending on the tenant logged in.

Can this be done in Outsystems ?
And if so, what is the best approach ?

One comment I'll add to this older thread:

It's extremely dangerous to design the tables with multiple tenants/companies in the single database.
It can be done, but a mistake/bug could mean -> one company seeing another company's data.
There could be serious repercussions.

While it's attractive to consolidate this, in my opinion, the only way is to have a separate instance/database
for each tenant customer.   
Hi Frank,

That's exactly the reason!
That's why I'm asking if an architecture like "single instance/multiple tenant database" is possible in Outsystems.
Any response from Outsystems ?

Thanks in advance,
Pedro Moita.

An architecture (client/server, web, whatever...),  even with the simplicity of developing with outsystems, it's not like playing with legos. We don't take architecture decisions just based on modules and functionalities. It is required  to know other stuff like, points of integration, number of expected/real users, existing data, expecting user roles, major business process, data flows, amount of transactions expected, and so on and so on... 

Architecture is one of the topics of the Delivery Manager training materials, and is discuss more in details in a Delivery Manager bootcamp , and of course, is something that a Delivery Manager gets from projects experience and designing solutions.

If you want to know if outsystems platform have the multitenancy, yes it have, and it can be by defined by espace or entity, and you can check how it works here by espace and here by entity

In this case, "THE" opinion to your decision is something that you can't expect to have it here because, we don't have the information needed to decide wich is the best approach to your problem. I strongly recommends you to contact the OutSystems Services to help you in that project.

To get in contact, email to