Quill
Multi-tenant

Overview

Multi-tenant

View as MarkdownThe whole page, as plain Markdown.

Reuse your existing multi-tenant definitions and RBAC. The most common setup is one tenant (typically organization_id or user_id), but we support parent-child relationships, and any relationship you can write in SQL.

  • Tenant field: the foreign key that separates data by Tenant ID on a table. We use this field to validate that a table in the Quill semantic layer can be referenced in dashboards owned by that tenant.
  • Tenant ID: the id value that corresponds to one specific tenant value (ex: organization_id=1)

Row vs database tenancy

Row tenancy keeps every tenant in the same tables, told apart by a column. Database tenancy gives each tenant a database of its own.

Row tenancyDatabase tenancyordersorganization_id = acmeorganization_id = northwindacme_dbnorthwind_db

Tenant ownership

A semantic layer table is owned by at least one tenant type (except for specialized tables that don't house customer data like constant tables). Ownership is verified by tenant field: the semantic layer table must have the tenant field of a tenant type that owns it.

Owned by OrganizationOwned by UserDashboardsDashboardsVirtual tablesVirtual tablesSalesordersinvoicesMy ordersorders

Each dashboard is owned by one tenant type. It can only use virtual tables and saved queries that are owned by that tenant type.

Dashboard (owner tenant) orders (Organization, User) invoices (Organization)
Sales (Organization) ✓ ✓
My orders (User) ✓ —

Tenant relationships

A mapping is a SQL query that defines the relationship between tenants. The most common example is parent-child, but you can define sibling relationship (ex: the client, vendor, and accountant roles in invoicing software)

Parent CompanySupply CompanyTransportation Company

Report tenant access

A report is visible to every tenant by default (Global). Admins can only show a report to a subset of end users by id and/or tenant type.

Custom reportAcmeInitechNorthwind