PDA

View Full Version : Database tenancies explained



barrymavin
2015-03-17, 23:55
Since v1.3 Lianja Cloud Server supports database tenancies.

Database tenancies are based on the authenticated user.

The "Database" used by an App for a user in a specified tenancy is postfixed with an "_" followed by the tenancy (domain) for the user specified in the "Users" workspace.

For example, if the database for an App is southwind and the user has a tenacy (domain) specified of xyzco then the database used for that user will be southwind_xyzco.

When the user authenticates in Desktop, Web or Mobile apps the specified database will be used rather than the default database for the App. Remember to "Deploy" the system!sysroles table and the database for that tenancy from the "Deploy" workspace.

Note that if the tenancy name contains '.' or '@' characters these are replaced with '_' characters e.g. lianja.com using the southwind database would expect the database southwind_lianja_com to exist. You can "copy" a complete database to another using the COPY DATABASE command in the console or the "Copy" menu selection in the "Data" workspace.

Important: To enable database tenancies you need to specify the "Runtime database" in the App Settings.

This provides you with the ability to deploy your Apps but have separate databases specific to each "tenant" or "customer" that you sell to.