Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

Multitenant Support on the Platform starts on from Release 1.6.0-empire.

However, it is a functionality in continuous improvement so the use of updated versions is recommended.

...

This model differs from architectures with multiple instances where each organization or client has its own installed instance of the application since in a multitenant architecture the application can virtually partition its data and configuration so that each client has a virtual instance adapted to its requirements.

You can find more details about Multitenant, its advantages, etc., in this entry: A Look at Multitenant: What it is and how it is supported on the Platform

Multitenant Support in Platform

The Multitenant Platform functionality is supported on 2 concepts:

  • Vertical: it represents a specific product and project. Suppose Imagine the deployment of Platform on an organization that offers products in SaaS mode, in that case : In this case, we could have different verticals deployed on an instance, for example Vertical Smart Home, Vertical Waste Management, ...

  • Tenant: represents a client that to whom the organization serves its products, for example we could offer the Smart Home solution to Carrefour, Leroy Merlin, ...

With the support of Onesait Platform with a single platform instance we could serve several verticals and tenants.

The platform capabilities in terms of multi-tenant mode are thus reflected:

  • Each Vertical has its own ConfigDB, or in other words, each Vertical can create its own platform concepts independently from the rest, that is, its ontologies, APIs, DataFlows, microservices, dashboards,...

  • Each tenant has its own RealTimeDB: , so each tenant's data is stored independently and not mixed.

  • Users are general to the whole platform instance and can be associated to vertials and tenants.

As we will see later on, the platform manages all this in a transparent way, abstracting the user from the complexities.

In the following diagram, we can see an example of a case of use of the platform in multitenant mode:

...

Considerations on the Installation

New installation with version 1.6.0-Empire or higher

When a new installation is made, without data in the ConfigDB, the UPDATE_MODE_MULTITENANT environment variable must be set to false. If this variable is not set to false, warning messages will appear.

This variable is designed to upgrade environments that already have data, so that existing data is migrated to the master database (users, tokens...).

Upgrade to version 1.6.0-Empire or higher

If an environment is upgraded to this version, you do not need to specify anything.

Multitenant environment configuration

To use the environment in multitenant mode, simply indicate the environment variable MULTITENANCY_ENABLED as 'true' in the Controlpanel and OAuth Server modules:

...

If you enter with the user platform_admin, you will see a screen with the list of platform verticals:

...

You must copy the configuration database schema’s name, then launch the config-init service, with the environment variable CONFIGDB_SCHEMA with that value:Tenemos que copiar el nombre del esquema de base de datos de configuración, y lanzar el servicio config-init, con la variable de entorno CONFIGDB_SCHEMA con ese valor:

...

This will load the basic configuration data for the new vertical.

In addition, an administrator user will be created for the vertical, following the format ‘administrator_ {vertical}’, iIn this case it will be administrator_waste, with the default password OpenP2019! and a default client for vertical development, with development format.

...

With the user-administrator of the vertical, you can create tenants. Go to the menu option ‘Tenant Management’, under the Administration level:

...

However, if you add the vertical, it will assign you the right role:

...

Considerations on installation

New installation with version 1.6.0-Empire or higher

When a new installation is performed, without data in the ConfigDB, you will need to change the UPDATE_MODE_MULTITENANT environment variable to false. If this variable is not set to false, warning messages will appear.

This variable is intended to do upgrades on environments that already have data, so that existing data are migrated to the master database (users, tokens ...).

Upgrade to version 1.6.0-Empire or higher

If an environment is updated to this version, you will not need to specify anything.