My first attempt to create a multi-tenant Ligthswitch application.

First and foremost let me define what is multitenancy:

Multitenancy refers to a principle in software architecture where a single instance of the software runs on a server, serving multiple client organizations (tenants). – wiki

Multitenancy is one basic attribute of true cloud computing.  To implement it in Lightswitch just follow the steps below:

STEP 1. In designing the database, the master files should have a user identifier field and the transaction should have a transaction group identifier.  The transaction group is part of the master file.

STEP 2. Make an authentication routine in your Lightswitch Home screen.

STEP 3. In every screen of your application, provide a user property that will filter off all the data sources associated to that screen.

To illustrate the steps I mentioned above let me dissect a real and running application, Filbroker application, which currently has two active customers (Real-estate Developers).

For STEP 1: As shown in the ERD image below, the master file project has a user identifier from the developer user.

b1

For STEP 2: Modified authentication screen as shown in the image below.

b2

For STEP 3:  Each screen has a developer property that will filter of all the data in the list, e.g., unit inventory.

b3

That’s it.  Keep building.

Advertisements

4 thoughts on “My first attempt to create a multi-tenant Ligthswitch application.

  1. Great post.
    Did you replace the standard login screen?
    How do you handle user management, roles and permissions?
    Thank you
    Victor

      1. Unfortunately I don’t have a snippet for the entire process. If you want to I can give you the entire app, just email me for details.

        But in jest, these are the processes

        1. Create your own user database and screen database
        2. Make a login screen, and make it a startup screen
        3. Once authenticated via the user database, save the session information in the global variable class
        4. Authorize the screen based on the global variable class upon openning/creating

        Thats it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s