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
About

Software developer living in the Philippines.

Posted in Lightswitch
4 comments on “My first attempt to create a multi-tenant Ligthswitch application.
  1. Victor Espinoza says:

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

    • hgminerva says:

      Nope, I created my own login screen using standard screen.

      I made my own user roles and permission as well as screen security.

      • Victor Espinoza says:

        Do you have a sample app of your custom login approach?
        Thank you
        Victor

      • hgminerva says:

        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

Author

Harold Glenn P. Minerva
Software Developer / Tech Enthusiast
Living in the Philippines

View Harold Glenn Minerva's profile on LinkedIn

Instagram

Software Engineer - Seasonal and Range Trading Software. Magenta Trader is a powerful stock market visualization software that increases your probability of trading success.

Software Architect and Founder - Easyfis.com is a multi-tenant cloud-based Software-as-a-Service (SaaS) business app that caters to micro, small and medium trading businesses.

CTO and Co-Founder - We give your company the leverage by providing innovative software solutions products such as Point-of-Sales (POS), Financial Information System (FMIS), Payroll and DTR (HRIS), and many more.

%d bloggers like this: