Introduction
Multi-Tenant in OutSystems is a key architectural pattern in modern enterprise and SaaS applications. It enables a single application instance to serve multiple customers (tenants) while ensuring data isolation, configurable settings, and efficient resource utilization. OutSystems provides built-in low code platform capabilities to simplify tenant management and data isolation.

Benefits of Multi-Tenancy
1. Cost Efficiency – Reduces infrastructure costs by deploying a single application for multiple customers.
2. Security and Isolation – Enforces strict data and session segregation between tenants.
3. Simplified Maintenance – Enables centralized codebase maintenance while serving multiple tenants.
4. Scalability – Easily onboard new customers without major infrastructure changes.
Multi-Tenancy in OutSystems
How OutSystems Manages Tenants
• Each tenant is associated with a User Provider, managing authentication and access control.
• Applications start with a single tenant by default, but additional tenants can be created.
• Anonymous users belong to the default tenant until they log in.
• When a user logs in, their session is bound to a specific tenant, ensuring all queries and data interactions are tenant-specific.
Setting Up a Multi-Tenant Application in OutSystems
1. Configure the Module
• Set ‘Is Multi-Tenant in OutSystems ’ to ‘Yes’ in Module Properties to ensure tenant-specific sessions, data, and processes.
2. Configure Entities
• Multi-Tenant Entities – Set ‘Is Multi-Tenant’ to ‘Yes’ for tenant-specific data like Customers and Invoices.
• Single-Tenant Entities – Keep ‘Is Multi-Tenant’ as ‘No’ for shared data like Countries and Currency Exchange Rates.
• Static Entities are always shared across tenants.
3. Configure Site Properties
• Multi-Tenant Site Properties – Store tenant-specific settings (e.g., Default Currency).
• Single-Tenant Site Properties – Store global settings (e.g., Login Retry Attempts).
4. Configure Timers
• Multi-Tenant Timers – Run separately for each tenant (e.g., generating tenant-specific reports).
• Single-Tenant Timers – Run once globally (e.g., updating exchange rates).
Managing User Sessions Across Tenants
• Default User Provider – Ensures user sessions are bound to their respective Multi-Tenant in OutSystems upon login.
• Custom User Provider – Requires manually binding users to a tenant using TenantSwitch.
Tenant and User Management
Front Office (Self-Provisioning Tenants)
• Users create their own tenants by providing Tenant Name and Admin Credentials.
• The platform automatically assigns an admin user to the new tenant.
Back Office (Admin-Managed Tenants)
• IT admins centrally manage tenants through a single-tenant management module.
• Admins can create tenants, assign users, and manage access levels.
Example: Converting a Single-Tenant Sales Application to Multi-Tenant
1. Identify Existing Modules
• Sales Module – Handles sales-related data like Opportunities and Invoices.
• Customers Module – Stores customer data.
• SelfRegister Module – Handles new user registrations.
• SalesSampleData Module – Contains sample sales data.
2. Enable Multi-Tenancy in Modules
• Set ‘Is Multi-Tenant’ to ‘Yes’ in the Module Properties of Sales, Customers, and SelfRegister.

3. Configure Entity Data Isolation
• Multi-Tenant Entities – Ensure ‘Is Multi-Tenant’ is set for data like Contacts, Opportunities, and Invoices.
• Single-Tenant Entities – Keep ‘Is Multi-Tenant’ as ‘No’ for shared reference data like Countries and Exchange Rates.
4. Configure Site Properties
• Multi-Tenant Site Properties – Store settings separately for each tenant (e.g., currency preferences).
• Single-Tenant Site Properties – Use for global settings (e.g., Login Retry Attempts).
5. Configure Timers
• Multi-Tenant Timers – Execute per tenant for reports.
• Single-Tenant Timers – Execute globally for system-wide updates.
6. Implement User & Tenant Management
A. Front Office: Self-Provisioning Tenants
• Users register a new tenant via a Sign-Up form.

• The system automatically creates the tenant and assigns an admin user.

• Uses TenantSwitch to transition the new admin into their tenant.
B. Back Office: Admin-Managed Tenants
• Admins manage tenants and users via a dedicated Tenant Management module.

• Uses ‘Show Tenant Identifier’ to view users across tenants.

• Enables tenant-level user assignments and role management.
Testing Multi-Tenancy
• Register multiple tenants and verify user isolation.
• Log in as different users and confirm that they see only their own data.
• Validate that tenant isolation works correctly in the database.

Conclusion
Multi-Tenant in OutSystems is a powerful feature that enables SaaS and enterprise applications to serve multiple customers efficiently. By properly configuring modules, entities, site properties, and timers, developers can achieve strong tenant isolation while simplifying maintenance.