Skip to content

Multi-Tenancy Overview

Mantis provides full multi-tenant support, enabling organizations to isolate resources, users, and deployments by tenant.

Multi-tenancy allows a single Mantis installation to serve multiple customers, teams, or organizational units while maintaining strict data isolation.

FeatureDescription
Resource IsolationTenants cannot see or access other tenants’ resources
Solution EntitlementsAssign solutions per tenant/environment
Target AssignmentBind targets to specific tenants
Variable ScopingTenant-specific configuration variables
User ScopingUsers belong to specific tenants
Audit IsolationAudit logs filtered by tenant
FieldTypeDescription
idUUIDUnique identifier
nameStringUnique tenant name
descriptionStringOptional description
logo_urlURLOptional branding logo
contact_emailEmailPrimary contact email
created_atDateTimeCreation timestamp
updated_atDateTimeLast update timestamp

Actions, Sequences, Solutions, and Environments each carry a nullable tenant_id column, so they are optionally tenant-scoped:

  • When tenant_id is NULL, the resource is global — visible to every tenant (and to global/admin users).
  • When tenant_id is set, the resource is tenant-private — visible only within that tenant.
LevelResourcesVisibility
GlobalActions, Sequences, Solutions, Environments (when tenant_id is NULL)All tenants
Tenant (optional)Actions, Sequences, Solutions, Environments (when tenant_id is set)Owning tenant only
TenantTargets, Variables, Users, DeploymentsTenant-only
JunctionSolution-Environment links, Target assignmentsPer-tenant configuration

Users with tenant_id = NULL:

  • See all tenants
  • Manage platform resources
  • Configure any tenant
  • View all deployments

Users with tenant_id set:

  • See only their tenant
  • Access entitled solutions/environments
  • Deploy to assigned targets
  • View tenant-specific audit logs

Tenants don’t have direct access to solutions. Instead, you grant access through tenant-solution-environment links:

TenantSolutionEnvironmentActive
Acme CorpWebAppProduction
Acme CorpWebAppStaging
Acme CorpAPIProduction

Targets can be assigned to tenants globally or per-environment:

TargetTenantEnvironmentScope
web-01Acme CorpProductionSingle environment
web-02Acme Corp(all)All environments
api-01Acme Corp(all)All environments

Tenant variables provide tenant-specific configuration:

Later steps override earlier ones (step 5 is the final value). Environment-specificity is an attribute within the tenant tiers, not a separate “Environment Variable” tier.

TypeDescriptionUse Case
Template VariablesDefined by solution, values per tenantDatabase connection strings
Common VariablesFree-form key-value pairsCustom configuration
-- Core tenant table
CREATE TABLE tenants (
id UUID PRIMARY KEY,
name TEXT NOT NULL UNIQUE,
description TEXT,
logo_url TEXT,
contact_email TEXT,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP
);
-- Tenant-Solution-Environment junction
CREATE TABLE tenants_solutions_environments (
id UUID PRIMARY KEY,
tenant_id UUID NOT NULL REFERENCES tenants(id) ON DELETE CASCADE,
solution_id UUID NOT NULL REFERENCES solutions(id) ON DELETE CASCADE,
environment_id UUID NOT NULL REFERENCES environments(id) ON DELETE CASCADE,
is_active BOOLEAN NOT NULL DEFAULT TRUE,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE (tenant_id, solution_id, environment_id)
);
-- Tenant-Target assignment
CREATE TABLE tenants_targets (
id UUID PRIMARY KEY,
tenant_id UUID NOT NULL REFERENCES tenants(id) ON DELETE CASCADE,
target_id UUID NOT NULL REFERENCES targets(id) ON DELETE CASCADE,
environment_id UUID REFERENCES environments(id) ON DELETE CASCADE,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE (tenant_id, target_id, environment_id)
);
EndpointMethodDescription
/api/v1/tenantsGETList tenants
/api/v1/tenantsPOSTCreate tenant
/api/v1/tenants/{id}GETGet tenant details
/api/v1/tenants/{id}PUTUpdate tenant
/api/v1/tenants/{id}DELETEDelete tenant
/api/v1/tenants/{id}/solutionsGETList tenant solutions
/api/v1/tenants/{id}/solutionsPOSTAttach solution
/api/v1/tenants/{id}/targetsGETList tenant targets
/api/v1/tenants/{id}/targetsPOSTAttach target
/api/v1/tenants/{id}/variablesGETList tenant variables
/api/v1/tenants/{id}/variablesPOSTSet variable
/api/v1/tenants/{id}/deploymentsGETList tenant deployments
ActionRequired Permission
List tenantstenants:read
Create tenanttenants:create
Update tenanttenants:update
Delete tenanttenants:delete
Manage solutionstenants:manage_solutions
Manage targetstenants:manage_targets
Manage variablestenants:manage_variables
Manage tagstenants:manage_tags

Host multiple customers on shared infrastructure:

├── Tenant: Customer A
│ ├── Production deployment targets
│ ├── Customer-specific variables
│ └── Isolated audit trail
├── Tenant: Customer B
│ ├── Production deployment targets
│ ├── Customer-specific variables
│ └── Isolated audit trail

Separate organizational units:

├── Tenant: Engineering
│ ├── Dev/Staging environments
│ └── Engineering targets
├── Tenant: Operations
│ ├── Production environments
│ └── Production targets

Isolate environments:

├── Tenant: Development
│ ├── Development solutions
│ └── Non-production targets
├── Tenant: Production
│ ├── Promoted solutions
│ └── Production targets
ResourceConventionExample
Tenant nameOrganization/team nameacme-corp, engineering
VariablesLowercase with underscoresdatabase_connection_string
TagsDescriptive key:valueteam:platform, env:production
  1. Assign users to tenants - Don’t create platform-level users for tenant access
  2. Use SSO with tenant mapping - Configure IdP groups per tenant
  3. Audit regularly - Review tenant access and deployments
  4. Minimize cross-tenant access - Keep platform admins to a minimum
  1. Document tenant structure - Maintain tenant inventory
  2. Standardize entitlements - Create consistent solution-environment patterns
  3. Monitor per-tenant - Track deployment success rates by tenant
  4. Plan capacity - Consider tenant growth in infrastructure planning