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.
For STEP 2: Modified authentication screen as shown in the image below.
For STEP 3: Each screen has a developer property that will filter of all the data in the list, e.g., unit inventory.
That’s it. Keep building.