Skip to Content

Tenancy

Choose a tenancy model

Tell Databrain how your data separates one customer from another, so each customer sees only their own rows.

Tenancy tells Databrain which rows belong to which customer. Pick the shape your data already has. You do not change your data.

The three shapes

ShapeYour data looks likeDatabrain scopes a query by
TableOne shared set of tables. A column such as client_id, org_id or tenant_id says who owns each row.A filter on that column.
DatabaseEach customer has their own database or schema on one connection.The customer’s database or schema.
Multi-databaseEach customer has a fully separate database on one SQL Server or Microsoft Fabric server.The customer’s database.
  • Table suits most products. It is the default.
  • Multi-database shows only for Microsoft SQL Server and Microsoft Fabric when Enable Multiple Databases is on and Databrain can see more than one database. It is then the only choice.
  • Elasticsearch and OpenSearch support only Table.

Where you set it

Datamart Tenancy tab with the Table-level option highlighted next to Schema or database-level, and the note that the level cannot change after it is saved.
Pick the tenancy level on the datamart's Tenancy tab. It cannot change after you save.

You can set tenancy in two places:

  1. On the datasource, under its Tenancy tab. See Set tenancy on a datasource.
  2. On the datamart, under its Tenancy tab. See Set tenancy on a datamart.

The model’s tenancy wins. The datasource setting is used only for workspaces that have no model.

How Table tenancy filters your SQL

Databrain fills in the client for SQL that compares your customer column to 'client_id_variable', and for builder metrics that carry a client filter:

SELECT order_date, SUM(amount) AS revenue
FROM orders
WHERE client_id = 'client_id_variable'
GROUP BY order_date

A custom SQL metric without 'client_id_variable' shows every customer’s rows in an embed. When tenant enforcement is on, Databrain refuses the metric instead.

Before you save

  • On a datamart, the tenancy level cannot change after you save it, because that would re-scope every embed of the datamart.
  • Saving tenancy on a datasource removes the default client from every data app embed in your company. See Set tenancy on a datasource.

On this page