How DataBrain enforces tenant isolation: Workspace vs Datamart vs Data App vs Client Group, guest-token variables, Manage Metrics scope, and the master + client dashboards pattern.
This is the single reference for how DataBrain enforces tenant isolation and metric visibility when you embed dashboards in a multi-tenant application.
Concepts, top-down
Workspace — outermost container. Holds Data Sources, Datamarts, Data Apps, Dashboards, Metrics. Members and permissions are Workspace-scoped. Most teams run one Workspace.
Data Source — connection to your warehouse. Credentials live here.
Datamart — logical selection of tables, columns, relationships, and joins on top of a Data Source. This is where the Client ID column for tenant isolation is set, and where the semantic layer lives.
Data App — the unit of embedding. Carries the API key that authenticates guest-token minting and the reference to its Datamart. One Data App per embedding surface — you do not need a Data App per tenant.
Client Group — a logical grouping of end-tenants that share a dashboard structure.
Manage Metrics — a per-dashboard toggle that lets users pick which metrics appear. See the gotcha below before relying on it.
The tenant identifier: three names, three places
Name
Where
What it is
clientId
Guest-token JSON payload
Supplies the tenant value for the session. The only accepted spelling — client_id and tenant_id are rejected
'client_id_variable'
Custom metric SQL
A bare quoted token (no curly braces) substituted with the session’s tenant value at query time, e.g. WHERE client_column = 'client_id_variable'
{{DATABASE_NAME}}
Custom metric SQL
The only curly-brace tenancy variable — resolves to the tenant’s database/schema for database-per-tenant setups
Tenant-isolation strategies
1. Row-per-tenant (client_id column)
All tenants share tables; every table has a tenant column. Configure the Datamart’s Client ID column mapping. How the filter is applied depends on the metric type:
Builder (visual/dataset) metrics: DataBrain auto-injects the tenant filter into the query. Do not add your own.
Custom SQL metrics: include the customer condition explicitly unless you enable Automatic client scope for the guest session:
SELECT * FROM orders WHERE client_id = 'client_id_variable'
Without automatic client scope, custom SQL that omits the tenant filter can return every tenant’s rows. Include 'client_id_variable' in the customer condition, or enable params.accessPermissions.isAllowAutoClientScope with complete datamart client-column mappings and verify the query. Unmapped tables remain unfiltered by automatic scope. SQL already using a client equality placeholder keeps its existing substitution path.
2. Schema- or database-per-tenant
Each tenant has its own schema/database. Reference it in metric SQL via {{DATABASE_NAME}}, which resolves from the guest token’s clientId through the Datamart mapping.
Anti-pattern: hard-coded tenant IDs
Never save a literal tenant id in metric SQL (WHERE client_id = 'acme') — for example by saving a metric while previewing as a specific client. That literal ships to every viewer and has caused real cross-tenant data leaks. If a metric must be scoped to one tenant on purpose, use RLS or an App Filter in the guest token instead.
Manage Metrics scope — the important gotcha
Manage Metrics visibility is per-dashboard, not per-viewer. If Customer A unchecks a metric on a shared dashboard, it disappears for Customer B too. That is by design — do not use Manage Metrics for per-tenant metric visibility. Use the pattern below instead.
Master + client dashboards pattern
For “each customer picks their own metric subset from a shared library”:
Create one master dashboard with every metric in the library.
For each customer (or Client Group), create a client dashboard derived from the master — its own layout and visible-metric subset.
Embed the client dashboard per tenant with that tenant’s clientId in the guest token.
Client dashboards can be provisioned programmatically — via the Import Dashboard API or the MCP server’s create_embed tool (which can clone a templateDashboardId per client). Note that import/clone is a copy operation: later edits to the master do not propagate to already-created client dashboards.
Row-level security (RLS)
RLS (params.rlsSettings in the guest token) is an additional per-session constraint on top of tenant isolation — for example region = 'NA' for one user. It is enforced server-side and invisible to the end user. Do not use RLS as a substitute for the Datamart’s Client ID mapping.
Client selector
Embedded dashboards never render a client selector — the tenant is fixed by the guest token’s clientId. The client/database dropdown you see inside the DataBrain app is for workspace members previewing data as different clients; it is not part of the embed.
{"docsConfig":{"theme":"palm","$schema":"https://mintlify.com/docs.json","name":"Databrain","colors":{"primary":"#111111","light":"#7f7f7f","dark":"#ffffff"},"logo":{"light":"https://mintcdn.com/databrainlabs-bef6850a/oDO13AKpVJ1B8Og7/logo/light.png?fit=max\u0026auto=format\u0026n=oDO13AKpVJ1B8Og7\u0026q=85\u0026s=0c708a71f56a15124f892fa695426863","dark":"https://mintcdn.com/databrainlabs-bef6850a/oDO13AKpVJ1B8Og7/logo/dark.png?fit=max\u0026auto=format\u0026n=oDO13AKpVJ1B8Og7\u0026q=85\u0026s=6fb12763fdc54348f76186c9efbd9f5b","href":"https://www.usedatabrain.com/"},"favicon":"https://mintcdn.com/databrainlabs-bef6850a/Bksca58pXCRbdPly/images/icons/favicon-192x192.png?fit=max\u0026auto=format\u0026n=Bksca58pXCRbdPly\u0026q=85\u0026s=2dec67559aa77ee9b73dee6e5a9eedcc","appearance":{"default":"light"},"background":{"color":{"light":"#ffffff"}},"navbar":{"links":[{"href":"https://playground.usedatabrain.com/","label":"Embed Playground"}],"primary":{"type":"button","label":"Start Building","href":"https://app.usedatabrain.com/users/sign-up?_gl=1*er2uvq*_gcl_au*MjA0NTIyMzg1Ni4xNzQ5MDIwOTkw"}},"footer":{"socials":{"x":"https://x.com/databrainhq","linkedin":"https://linkedin.com/company/databrainhq","youtube":"https://youtube.com/@usedatabrain?feature=shared"}},"seo":{"metatags":{"canonical":"https://docs.usedatabrain.com"}},"fonts":{"heading":{"family":"Inter"},"body":{"family":"Inter"}},"styling":{"codeblocks":"dark","latex":false},"integrations":{"gtm":{"tagId":"GTM-TFBLH49"},"intercom":{"appId":"bk07fem4"},"posthog":{"apiKey":"phc_YgR4BO3sbtQAUvTfRUEN5xBzzPrJfrEG9STJEy3mNO2"}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"databrainlabs-bef6850a","hasAudioNarration":false,"actualSubdomain":"databrainlabs-bef6850a","customDomains":["docs.usedatabrain.com"],"gitSource":{"type":"github","owner":"databrainhq","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6afd9cd272017a95b626d37e","clientVersion":"0.0.4270","searchFilterCounts":[{"language":"default","tag":"Platform Guides","count":126},{"language":"default","tag":"Developer Docs","count":78},{"language":"default","tag":"API Reference","count":56},{"language":"default","tag":"Visualizations","count":30},{"language":"default","tag":"Data Sources","count":26},{"language":"default","tag":"Metrics","count":24},{"language":"default","tag":"Chart Setup","count":21},{"language":"default","tag":"Supported Connectors","count":19},{"language":"default","tag":"Dashboards","count":14},{"language":"default","tag":"Self-Hosted Deployment","count":13}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"styles.css","content":"body{font-family:'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;line-height:1.6;color:#374151}[data-mode=\"wide\"] h1{font-size:2.5rem;font-weight:700;margin-bottom:1.5rem;color:#111827;line-height:1.2}[data-mode=\"wide\"] h2{font-size:1.875rem;font-weight:600;margin-top:2.5rem;margin-bottom:1rem;color:#111827;line-height:1.3}[data-mode=\"wide\"] h3{font-size:1.5rem;font-weight:600;margin-top:2rem;margin-bottom:0.75rem;color:#111827;line-height:1.4}[data-mode=\"wide\"] p{margin-bottom:1.25rem;word-wrap:break-word;overflow-wrap:break-word;color:#374151;line-height:1.7}[data-mode=\"wide\"] code{font-family:'JetBrains Mono', 'Fira Code', Consolas, monospace;font-size:0.875rem}[data-mode=\"wide\"] p code,[data-mode=\"wide\"] li code,[data-mode=\"wide\"] td code{background-color:#f3f4f6;color:#1f2937;padding:0.125rem 0.375rem;border-radius:4px;font-size:0.8125rem;font-weight:500;word-break:break-word}[data-mode=\"wide\"] pre{background-color:#1f2937;border-radius:8px;padding:1.5rem;margin:1.5rem 0;overflow-x:auto;border:1px solid #374151}[data-mode=\"wide\"] pre code{color:#e5e7eb;font-size:0.875rem;line-height:1.6}[data-mode=\"wide\"] a{color:#111111;text-decoration:underline;text-underline-offset:2px;transition:color 0.2s ease}[data-mode=\"wide\"] a:hover{color:#7f7f7f}[data-mode=\"wide\"] table{width:100%;border-collapse:collapse;margin:1.5rem 0;font-size:0.875rem;border-radius:8px;overflow:hidden;box-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.1);border:1px solid #e5e7eb}[data-mode=\"wide\"] table th,[data-mode=\"wide\"] table td{padding:1rem;text-align:left;border-bottom:1px solid #e5e7eb;word-wrap:break-word;vertical-align:top}[data-mode=\"wide\"] table th{background-color:#f9fafb;font-weight:600;color:#111827;font-size:0.875rem}[data-mode=\"wide\"] table tbody tr:hover{background-color:#f9fafb}[data-mode=\"wide\"] table tbody tr:last-child td{border-bottom:none}[data-mode=\"wide\"] ul,[data-mode=\"wide\"] ol{margin-bottom:1.25rem;padding-left:1.5rem}[data-mode=\"wide\"] li{margin-bottom:0.5rem;line-height:1.6}[data-mode=\"wide\"] li p{margin-bottom:0.5rem}[data-mode=\"wide\"] .frame,[data-mode=\"wide\"] [class*=\"frame\"]{margin:1.5rem 0;border-radius:8px;overflow:hidden;box-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.1)}[data-mode=\"wide\"] .card,[data-mode=\"wide\"] [class*=\"card\"]{margin:1rem 0;border-radius:8px;border:1px solid #e5e7eb;transition:all 0.2s ease}[data-mode=\"wide\"] .card:hover,[data-mode=\"wide\"] [class*=\"card\"]:hover{box-shadow:0 4px 12px 0 rgba(0, 0, 0, 0.1);transform:translateY(-1px)}[data-mode=\"wide\"] blockquote{border-left:4px solid #111111;padding:1rem 1rem 1rem 1.5rem;margin:1.5rem 0;background-color:#f9fafb;border-radius:0 8px 8px 0;font-style:italic;color:#6b7280}[data-mode=\"wide\"] h2+table,[data-mode=\"wide\"] h3+table,[data-mode=\"wide\"] h2+pre,[data-mode=\"wide\"] h3+pre{margin-top:1rem}[data-mode=\"wide\"] p+pre,[data-mode=\"wide\"] ul+pre,[data-mode=\"wide\"] ol+pre{margin-top:1rem}[data-mode=\"wide\"] ::selection{background-color:#ddd6fe;color:#1f2937}.right-panel{width:400px!important}div[data-orientation=\"right\"]{width:400px!important}[data-mode=\"wide\"] .panel,[data-mode=\"wide\"] [class*=\"panel\"],aside[class*=\"right\"],nav[class*=\"right\"]{width:400px!important;min-width:400px!important;max-width:400px!important}#navbar nav a[href*=\"playground.usedatabrain.com\"],#navbar #topbar-cta-button{box-sizing:border-box!important;display:inline-flex!important;flex-direction:row!important;align-items:center!important;justify-content:center!important;gap:8px!important;width:168px!important;min-width:168px!important;max-width:168px!important;height:36px!important;min-height:36px!important;max-height:36px!important;padding:0 12px!important;border-radius:4px!important;border-width:1px!important;border-style:solid!important;font-family:'SF Mono', 'SFMono-Regular', ui-monospace, 'Cascadia Mono', 'Segoe UI Mono', Menlo, Monaco, Consolas, monospace!important;font-size:0.875rem!important;font-weight:500!important;line-height:1!important;text-decoration:none!important;white-space:nowrap!important;transition:all 0.2s ease!important}@media (max-width: 1023px){#navbar #topbar-cta-button{display:none!important}}#navbar nav a[href*=\"playground.usedatabrain.com\"]{background-color:#ffffff!important;border-color:#d1d5db!important;color:#1f2937!important}#navbar nav a[href*=\"playground.usedatabrain.com\"] *{color:#1f2937!important}#navbar nav a[href*=\"playground.usedatabrain.com\"]:hover{background-color:#f3f4f6!important;border-color:#9ca3af!important;color:#111827!important}#navbar #topbar-cta-button{background-color:#0d0d0d!important;border-color:#404040!important;cursor:pointer!important}#navbar #topbar-cta-button:hover{background-color:#1a1a1a!important;border-color:#525252!important}#navbar #topbar-cta-button>a{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:100%!important;height:100%!important;margin:0!important;padding:0!important;line-height:1!important;text-decoration:none!important}#navbar #topbar-cta-button>a>div{display:inline-flex!important;align-items:center!important;margin:0!important;padding:0!important;line-height:1!important}#navbar #topbar-cta-button,#navbar #topbar-cta-button *{color:#ffffff!important;visibility:visible!important;opacity:1!important}#navbar #topbar-cta-button svg{display:none!important}#navbar a,#navbar button,#navbar span{visibility:visible!important;opacity:1!important}#sidebar-content .method-nav-pill>span[class*=\"bg-[#2AB673]\"]{background-color:rgba(74, 222, 128, 0.2)!important;color:#15803d!important}#sidebar-content .method-nav-pill>span[class*=\"bg-[#3064E3]\"]{background-color:rgba(96, 165, 250, 0.2)!important;color:#1d4ed8!important}#sidebar-content .method-nav-pill>span[class*=\"bg-[#C28C30]\"]{background-color:rgba(250, 204, 21, 0.2)!important;color:#a16207!important}#sidebar-content .method-nav-pill>span[class*=\"bg-[#CB3A32]\"]{background-color:rgba(248, 113, 113, 0.2)!important;color:#b91c1c!important}html.dark #sidebar-content .method-nav-pill>span[class*=\"bg-[#2AB673]\"]{color:#4ade80!important}html.dark #sidebar-content .method-nav-pill>span[class*=\"bg-[#3064E3]\"]{color:#60a5fa!important}html.dark #sidebar-content .method-nav-pill>span[class*=\"bg-[#C28C30]\"]{color:#facc15!important}html.dark #sidebar-content .method-nav-pill>span[class*=\"bg-[#CB3A32]\"]{color:#f87171!important}"}]}
{"page":{"pagePath":"developer-docs/tenancy-model","slug":"/developer-docs/tenancy-model","pageMetadata":{"title":"Tenancy Model","description":"How DataBrain enforces tenant isolation: Workspace vs Datamart vs Data App vs Client Group, guest-token variables, Manage Metrics scope, and the master + client dashboards pattern.","mode":"wide","href":"/developer-docs/tenancy-model"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"How DataBrain enforces tenant isolation: Workspace vs Datamart vs Data App vs Client Group, guest-token variables, Manage Metrics scope, and the master + client dashboards pattern.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,ol:`ol`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`This is the single reference for how DataBrain enforces tenant isolation and metric visibility when you embed dashboards in a multi-tenant application.`}),`\n`,_jsx(Heading,{level:`2`,id:`concepts-top-down`,children:`Concepts, top-down`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Workspace`}),` — outermost container. Holds Data Sources, Datamarts, Data Apps, Dashboards, Metrics. Members and permissions are Workspace-scoped. Most teams run one Workspace.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Data Source`}),` — connection to your warehouse. Credentials live here.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Datamart`}),` — logical selection of tables, columns, relationships, and joins on top of a Data Source. This is where the `,_jsx(_components.strong,{children:`Client ID column`}),` for tenant isolation is set, and where the semantic layer lives.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Data App`}),` — the unit of embedding. Carries the API key that authenticates guest-token minting and the reference to its Datamart. One Data App per embedding surface — you do `,_jsx(_components.strong,{children:`not`}),` need a Data App per tenant.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Client Group`}),` — a logical grouping of end-tenants that share a dashboard structure.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Manage Metrics`}),` — a per-dashboard toggle that lets users pick which metrics appear. See the gotcha below before relying on it.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`the-tenant-identifier-three-names-three-places`,children:`The tenant identifier: three names, three places`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Name`}),_jsx(_components.th,{children:`Where`}),_jsx(_components.th,{children:`What it is`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`clientId`})}),_jsx(_components.td,{children:`Guest-token JSON payload`}),_jsxs(_components.td,{children:[`Supplies the tenant value for the session. The only accepted spelling — `,_jsx(_components.code,{children:`client_id`}),` and `,_jsx(_components.code,{children:`tenant_id`}),` are rejected`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`'client_id_variable'`})}),_jsx(_components.td,{children:`Custom metric SQL`}),_jsxs(_components.td,{children:[`A `,_jsx(_components.strong,{children:`bare quoted token`}),` (no curly braces) substituted with the session’s tenant value at query time, e.g. `,_jsx(_components.code,{children:`WHERE client_column = 'client_id_variable'`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`{{DATABASE_NAME}}`})}),_jsx(_components.td,{children:`Custom metric SQL`}),_jsx(_components.td,{children:`The only curly-brace tenancy variable — resolves to the tenant’s database/schema for database-per-tenant setups`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`tenant-isolation-strategies`,children:`Tenant-isolation strategies`}),`\n`,_jsx(Heading,{level:`3`,id:`1-row-per-tenant-client_id-column`,children:`1. Row-per-tenant (client_id column)`}),`\n`,_jsx(_components.p,{children:`All tenants share tables; every table has a tenant column. Configure the Datamart’s Client ID column mapping. How the filter is applied depends on the metric type:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Builder (visual/dataset) metrics:`}),` DataBrain auto-injects the tenant filter into the query. Do not add your own.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Custom SQL metrics:`}),` include the customer condition explicitly unless you enable `,_jsx(_components.a,{href:`/guides/datasources/automatic-client-scope`,children:`Automatic client scope`}),` for the guest session:`]}),`\n`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes dark-plus dark-plus`,style:{backgroundColor:`#0B0C0E`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`SELECT`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` * `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`FROM`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` orders `}),_jsx(_components.span,{style:{color:`#569CD6`,\"--shiki-dark\":`#569CD6`},children:`WHERE`}),_jsx(_components.span,{style:{color:`#D4D4D4`,\"--shiki-dark\":`#D4D4D4`},children:` client_id = `}),_jsx(_components.span,{style:{color:`#CE9178`,\"--shiki-dark\":`#CE9178`},children:`'client_id_variable'`})]}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Without automatic client scope, custom SQL that omits the tenant filter can return every tenant’s rows. Include `,_jsx(_components.code,{children:`'client_id_variable'`}),` in the customer condition, or enable `,_jsx(_components.code,{children:`params.accessPermissions.isAllowAutoClientScope`}),` with complete datamart client-column mappings and verify the query. Unmapped tables remain unfiltered by automatic scope. SQL already using a client equality placeholder keeps its existing substitution path.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`2-schema-or-database-per-tenant`,children:`2. Schema- or database-per-tenant`}),`\n`,_jsxs(_components.p,{children:[`Each tenant has its own schema/database. Reference it in metric SQL via `,_jsx(_components.code,{children:`{{DATABASE_NAME}}`}),`, which resolves from the guest token’s `,_jsx(_components.code,{children:`clientId`}),` through the Datamart mapping.`]}),`\n`,_jsx(Heading,{level:`3`,id:`anti-pattern-hard-coded-tenant-ids`,children:`Anti-pattern: hard-coded tenant IDs`}),`\n`,_jsxs(_components.p,{children:[`Never save a literal tenant id in metric SQL (`,_jsx(_components.code,{children:`WHERE client_id = 'acme'`}),`) — for example by saving a metric while previewing as a specific client. That literal ships to `,_jsx(_components.strong,{children:`every`}),` viewer and has caused real cross-tenant data leaks. If a metric must be scoped to one tenant on purpose, use RLS or an App Filter in the guest token instead.`]}),`\n`,_jsx(Heading,{level:`2`,id:`manage-metrics-scope-—-the-important-gotcha`,children:`Manage Metrics scope — the important gotcha`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Manage Metrics visibility is per-dashboard, not per-viewer.`}),` If Customer A unchecks a metric on a shared dashboard, it disappears for Customer B too. That is by design — do not use Manage Metrics for per-tenant metric visibility. Use the pattern below instead.`]}),`\n`,_jsx(Heading,{level:`2`,id:`master-+-client-dashboards-pattern`,children:`Master + client dashboards pattern`}),`\n`,_jsx(_components.p,{children:`For “each customer picks their own metric subset from a shared library”:`}),`\n`,_jsxs(_components.ol,{children:[`\n`,_jsxs(_components.li,{children:[`Create one `,_jsx(_components.strong,{children:`master dashboard`}),` with every metric in the library.`]}),`\n`,_jsxs(_components.li,{children:[`For each customer (or Client Group), create a `,_jsx(_components.strong,{children:`client dashboard`}),` derived from the master — its own layout and visible-metric subset.`]}),`\n`,_jsxs(_components.li,{children:[`Embed the client dashboard per tenant with that tenant’s `,_jsx(_components.code,{children:`clientId`}),` in the guest token.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Client dashboards can be provisioned programmatically — via the `,_jsx(_components.a,{href:`/developer-docs/helpers/api-reference/import-dashboard`,children:`Import Dashboard API`}),` or the MCP server’s `,_jsx(_components.code,{children:`create_embed`}),` tool (which can clone a `,_jsx(_components.code,{children:`templateDashboardId`}),` per client). Note that import/clone is a `,_jsx(_components.strong,{children:`copy`}),` operation: later edits to the master do not propagate to already-created client dashboards.`]}),`\n`,_jsx(Heading,{level:`2`,id:`row-level-security-rls`,children:`Row-level security (RLS)`}),`\n`,_jsxs(_components.p,{children:[`RLS (`,_jsx(_components.code,{children:`params.rlsSettings`}),` in the guest token) is an additional per-session constraint `,_jsx(_components.strong,{children:`on top of`}),` tenant isolation — for example `,_jsx(_components.code,{children:`region = 'NA'`}),` for one user. It is enforced server-side and invisible to the end user. Do not use RLS as a substitute for the Datamart’s Client ID mapping.`]}),`\n`,_jsx(Heading,{level:`2`,id:`client-selector`,children:`Client selector`}),`\n`,_jsxs(_components.p,{children:[`Embedded dashboards never render a client selector — the tenant is fixed by the guest token’s `,_jsx(_components.code,{children:`clientId`}),`. The client/database dropdown you see inside the DataBrain app is for workspace members previewing data as different clients; it is not part of the embed.`]}),`\n`,_jsx(Heading,{level:`2`,id:`where-each-setting-lives`,children:`Where each setting lives`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Setting`}),_jsx(_components.th,{children:`Where`}),_jsx(_components.th,{children:`Scope`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Client ID column mapping`}),_jsx(_components.td,{children:`Datamart`}),_jsx(_components.td,{children:`Per Datamart`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Data App API key`}),_jsx(_components.td,{children:`Data App`}),_jsx(_components.td,{children:`Per Data App`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Whitelist Domains`}),_jsx(_components.td,{children:`Edited from Data App settings`}),_jsx(_components.td,{children:`Account-wide (one list for all Data Apps)`})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[_jsx(_components.code,{children:`clientId`}),`, `,_jsx(_components.code,{children:`rlsSettings`}),`, `,_jsx(_components.code,{children:`appFilters`})]}),_jsx(_components.td,{children:`Guest token payload`}),_jsx(_components.td,{children:`Per session`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Manage Metrics toggle`}),_jsx(_components.td,{children:`Dashboard settings`}),_jsx(_components.td,{children:`Per dashboard, shared across viewers`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`Client Group membership`}),_jsx(_components.td,{children:`Workspace settings`}),_jsx(_components.td,{children:`Per tenant grouping`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`related`,children:`Related`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/developer-docs/helpers/api-reference/token`,children:`Guest Token`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/developer-docs/multi-tenant-access-control`,children:`Multi-Tenant Access Control`})}),`\n`,_jsx(_components.li,{children:_jsx(_components.a,{href:`/developer-docs/reference/error-codes`,children:`Error Codes Reference`})}),`\n`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"dark","config":{},"pageMetadata":{"title":"Tenancy Model","description":"How DataBrain enforces tenant isolation: Workspace vs Datamart vs Data App vs Client Group, guest-token variables, Manage Metrics scope, and the master + client dashboards pattern.","mode":"wide","href":"/developer-docs/tenancy-model"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Concepts, top-down","slug":"concepts-top-down","depth":2,"children":[]},{"title":"The tenant identifier: three names, three places","slug":"the-tenant-identifier-three-names-three-places","depth":2,"children":[]},{"title":"Tenant-isolation strategies","slug":"tenant-isolation-strategies","depth":2,"children":[{"title":"1. Row-per-tenant (client_id column)","slug":"1-row-per-tenant-client_id-column","depth":3,"children":[]},{"title":"2. Schema- or database-per-tenant","slug":"2-schema-or-database-per-tenant","depth":3,"children":[]},{"title":"Anti-pattern: hard-coded tenant IDs","slug":"anti-pattern-hard-coded-tenant-ids","depth":3,"children":[]}]},{"title":"Manage Metrics scope — the important gotcha","slug":"manage-metrics-scope-—-the-important-gotcha","depth":2,"children":[]},{"title":"Master + client dashboards pattern","slug":"master-+-client-dashboards-pattern","depth":2,"children":[]},{"title":"Row-level security (RLS)","slug":"row-level-security-rls","depth":2,"children":[]},{"title":"Client selector","slug":"client-selector","depth":2,"children":[]},{"title":"Where each setting lives","slug":"where-each-setting-lives","depth":2,"children":[]},{"title":"Related","slug":"related","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"databrainlabs-bef6850a","siteName":"Databrain","title":"Tenancy Model - Databrain","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-30T15:35:36.609Z","originalFileLocation":"developer-docs/tenancy-model.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"How DataBrain enforces tenant isolation: Workspace vs Datamart vs Data App vs Client Group, guest-token variables, Manage Metrics scope, and the master + client dashboards pattern.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Databrain\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/databrainlabs-bef6850a/QUX3KO15cdFhUybZ/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/databrainlabs-bef6850a/QUX3KO15cdFhUybZ/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/databrainlabs-bef6850a/QUX3KO15cdFhUybZ/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/databrainlabs-bef6850a/QUX3KO15cdFhUybZ/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/databrainlabs-bef6850a/QUX3KO15cdFhUybZ/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/databrainlabs-bef6850a/QUX3KO15cdFhUybZ/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/databrainlabs-bef6850a/QUX3KO15cdFhUybZ/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/databrainlabs-bef6850a/QUX3KO15cdFhUybZ/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/databrainlabs-bef6850a/QUX3KO15cdFhUybZ/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Tenancy Model - Databrain\">\u003cmeta data-mint-head property=\"og:description\" content=\"How DataBrain enforces tenant isolation: Workspace vs Datamart vs Data App vs Client Group, guest-token variables, Manage Metrics scope, and the master + client dashboards pattern.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Databrain\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.usedatabrain.com/developer-docs/tenancy-model\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://databrainlabs-bef6850a.mintlify.site/_mintlify/api/og/v2?division=Authentication+%26+Security\u0026amp;title=Tenancy+Model\u0026amp;description=How+DataBrain+enforces+tenant+isolation%3A+Workspace+vs+Datamart+vs+Data+App+vs+Client+Group%2C+guest-token+variables%2C+Manage+Metrics+scope%2C+and+the+master+%2B+client\u0026amp;theme=3e451e467e14706db3778871\u0026amp;signature=c0884ad8ecc8b41fa00863380220c0d5ecb2e6b602e6bf41a4eba9b5eb9a4ba4\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Tenancy Model - Databrain\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"How DataBrain enforces tenant isolation: Workspace vs Datamart vs Data App vs Client Group, guest-token variables, Manage Metrics scope, and the master + client dashboards pattern.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://databrainlabs-bef6850a.mintlify.site/_mintlify/api/og/v2?division=Authentication+%26+Security\u0026amp;title=Tenancy+Model\u0026amp;description=How+DataBrain+enforces+tenant+isolation%3A+Workspace+vs+Datamart+vs+Data+App+vs+Client+Group%2C+guest-token+variables%2C+Manage+Metrics+scope%2C+and+the+master+%2B+client\u0026amp;theme=3e451e467e14706db3778871\u0026amp;signature=c0884ad8ecc8b41fa00863380220c0d5ecb2e6b602e6bf41a4eba9b5eb9a4ba4\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/databrainlabs-bef6850a/QUX3KO15cdFhUybZ/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Databrain\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#111111\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.usedatabrain.com/developer-docs/tenancy-model\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/developer-docs/tenancy-model.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.usedatabrain.com/#organization\",\"name\":\"Databrain\",\"url\":\"https://docs.usedatabrain.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/databrainlabs-bef6850a/oDO13AKpVJ1B8Og7/logo/light.png?fit=max\u0026auto=format\u0026n=oDO13AKpVJ1B8Og7\u0026q=85\u0026s=0c708a71f56a15124f892fa695426863\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.usedatabrain.com#website\",\"name\":\"Databrain\",\"url\":\"https://docs.usedatabrain.com\",\"publisher\":{\"@id\":\"https://docs.usedatabrain.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.usedatabrain.com/developer-docs/tenancy-model#webpage\",\"url\":\"https://docs.usedatabrain.com/developer-docs/tenancy-model\",\"name\":\"Tenancy Model\",\"description\":\"How DataBrain enforces tenant isolation: Workspace vs Datamart vs Data App vs Client Group, guest-token variables, Manage Metrics scope, and the master + client dashboards pattern.\",\"dateModified\":\"2026-10-30T15:35:36.609Z\",\"isPartOf\":{\"@id\":\"https://docs.usedatabrain.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.usedatabrain.com/developer-docs/tenancy-model#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.usedatabrain.com/developer-docs/tenancy-model#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Authentication \u0026 Security\",\"item\":\"https://docs.usedatabrain.com/developer-docs/security\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tenancy Model\",\"item\":\"https://docs.usedatabrain.com/developer-docs/tenancy-model\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.usedatabrain.com/developer-docs/tenancy-model#article\",\"headline\":\"Tenancy Model\",\"name\":\"Tenancy Model\",\"description\":\"How DataBrain enforces tenant isolation: Workspace vs Datamart vs Data App vs Client Group, guest-token variables, Manage Metrics scope, and the master + client dashboards pattern.\",\"url\":\"https://docs.usedatabrain.com/developer-docs/tenancy-model\",\"mainEntityOfPage\":{\"@id\":\"https://docs.usedatabrain.com/developer-docs/tenancy-model#webpage\"},\"dateModified\":\"2026-10-30T15:35:36.609Z\",\"publisher\":{\"@id\":\"https://docs.usedatabrain.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.usedatabrain.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Databrain\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Databrain\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/developer-docs/tenancy-model.md","siteName":"Databrain","nav":{"global":null,"tabs":[{"tab":"Getting Started","pages":[{"title":"Getting Started","href":"/getting-started/introduction"}]},{"tab":"Platform Guides","pages":[{"title":"Platform Guides","href":"/guides/onboarding-and-configuration/onboarding"}]},{"tab":"Developer Docs","groups":[{"group":"Embedding Setup","icon":"gear","pages":[{"title":"Getting Started","mode":"wide","href":"/developer-docs"},{"title":"5-Minute Embedding Tutorial","mode":"wide","href":"/developer-docs/quick-start/embedding-tutorial"},{"title":"How to embed?","sidebarTitle":"How to Embed?","mode":"wide","href":"/developer-docs/how-to-embed"},{"title":"Production-Ready Embedding Guide","mode":"wide","href":"/developer-docs/embedding-setup/step-by-step-guide"},{"title":"Architecture Deep Dive","sidebarTitle":"Architecture Deep Dive","mode":"wide","href":"/developer-docs/embedding-setup/architecture-deep-dive"},{"group":"Finding Your IDs","pages":[{"title":"Dashboard id","sidebarTitle":"Dashboard ID","mode":"wide","href":"/developer-docs/helpers/dashboard-id"},{"title":"Metric ID","sidebarTitle":"Metric ID","mode":"wide","href":"/developer-docs/helpers/metric-id"},{"title":"Workspace name","sidebarTitle":"Workspace name","mode":"wide","href":"/developer-docs/helpers/workspace-name"},{"title":"API Token","sidebarTitle":"API Token","mode":"wide","href":"/developer-docs/helpers/api-token"}]}]},{"group":"MCP Server","icon":"wand-magic-sparkles","pages":[{"title":"MCP Server","sidebarTitle":"Overview","icon":"wand-magic-sparkles","mode":"wide","href":"/developer-docs/mcp-server/overview"},{"title":"Quickstart","icon":"bolt","mode":"wide","href":"/developer-docs/mcp-server/quickstart"},{"title":"Client Setup","icon":"gear","mode":"wide","href":"/developer-docs/mcp-server/client-setup"},{"title":"Workflows","icon":"route","mode":"wide","href":"/developer-docs/mcp-server/workflows"},{"title":"Tools Reference","icon":"wrench","mode":"wide","href":"/developer-docs/mcp-server/tools-reference"},{"title":"Prompts Reference","icon":"message-bot","mode":"wide","href":"/developer-docs/mcp-server/prompts-reference"},{"title":"Troubleshooting","icon":"wrench","mode":"wide","href":"/developer-docs/mcp-server/troubleshooting"}]},{"group":"Framework Integration","icon":"code","pages":[{"title":"Introduction","sidebarTitle":"Introduction","mode":"wide","href":"/developer-docs/framework-specific-guide"},{"title":"Reactjs","icon":"atom","mode":"wide","href":"/developer-docs/framework-specific-guide/reactjs"},{"title":"Nextjs","icon":"atom","mode":"wide","href":"/developer-docs/framework-specific-guide/nextjs"},{"title":"Vuejs","icon":"atom","mode":"wide","href":"/developer-docs/framework-specific-guide/vuejs"},{"title":"Angular","icon":"atom","mode":"wide","href":"/developer-docs/framework-specific-guide/angular"},{"title":"Svelte","icon":"atom","mode":"wide","href":"/developer-docs/framework-specific-guide/svelte"},{"title":"Solid","icon":"atom","mode":"wide","href":"/developer-docs/framework-specific-guide/solid"},{"title":"Vanilla JS","icon":"atom","mode":"wide","href":"/developer-docs/framework-specific-guide/vanillajs"}]},{"group":"Component Options","icon":"sliders","pages":[{"title":"Options","sidebarTitle":"Options","mode":"wide","href":"/developer-docs/helpers/options"},{"title":"Component Options Reference","sidebarTitle":"Options Reference","mode":"wide","href":"/developer-docs/helpers/component-options-reference"}]},{"group":"Authentication \u0026 Security","icon":"shield","pages":[{"title":"Security \u0026 Compliance","sidebarTitle":"Security \u0026 Compliance","mode":"wide","href":"/developer-docs/security"},{"group":"Token Management","pages":[{"title":"Token","mode":"wide","href":"/developer-docs/token"},{"title":"Token Body","mode":"wide","href":"/developer-docs/helpers/token-body"},{"title":"Proxy Authentication","mode":"wide","href":"/developer-docs/helpers/api-reference/proxy-authentication"},{"title":"Admin Authentication Flow","href":"/developer-docs/helpers/api-reference/admin-authentication-flow"},{"title":"Token API v1 → v2 Migration","mode":"wide","href":"/developer-docs/api-migration-guide"}]},{"title":"Multi-Tenant Access Control","description":"For your multi-tenant database architectures, establish atomic access controls through row-level policies (Database Tenancy \u0026 Table Tenancy), configurable in the Client Settings of our data source settings.","sidebarTitle":"Multi-Tenant Access Control","mode":"wide","href":"/developer-docs/multi-tenant-access-control"},{"title":"Tenancy Model","mode":"wide","href":"/developer-docs/tenancy-model"}]},{"group":"Filtering \u0026 Personalization","icon":"filter","pages":[{"title":"Metric App Filter","description":"Metric App Filter: Instruction Manual","sidebarTitle":"Metric App Filter","mode":"wide","href":"/developer-docs/helpers/metric-app-filter"},{"title":"Dashboard App Filter","sidebarTitle":"Dashboard App Filter","mode":"wide","href":"/developer-docs/helpers/dashboard-app-filter"}]},{"group":"Customization","icon":"paintbrush","pages":[{"title":"Override Language","sidebarTitle":"Override Language","mode":"wide","href":"/developer-docs/helpers/override-language"},{"title":"Translate","sidebarTitle":"Translate","mode":"wide","href":"/developer-docs/helpers/translate"}]},{"group":"Events \u0026 Interactions","icon":"bolt","pages":[{"title":"Server Event","mode":"wide","href":"/developer-docs/helpers/server-event"},{"title":"Embed Functions","sidebarTitle":"Embed Functions","mode":"wide","href":"/developer-docs/helpers/embed-functions"}]},{"group":"End-User Features","icon":"users","pages":[{"title":"End User Metric Creation","sidebarTitle":"End User Metric Creation","mode":"wide","href":"/developer-docs/helpers/end-user-metric-creation"},{"title":"End User Dashboard Creation","href":"/developer-docs/helpers/end-user-dashboard-creation"}]},{"group":"AI Chat Mode","icon":"message-bot","pages":[{"title":"Step 1: Create Datamart and Workspace","sidebarTitle":"Step 1: Create Datamart and Workspace","mode":"wide","href":"/developer-docs/chat-mode/step-1-create-datamart-and-workspace"},{"title":"Step 2: Create Data App and Embed ID","sidebarTitle":"Step 2: Create Data App and Embed ID","mode":"wide","href":"/developer-docs/chat-mode/step-2-create-data-app-and-embed-id"},{"group":"LLM Configuration","pages":[{"title":"LLM Architecture","sidebarTitle":"LLM Architecture","mode":"wide","href":"/developer-docs/helpers/llm-architecture"},{"title":"LLM Connectors","sidebarTitle":"Overview","mode":"wide","href":"/developer-docs/helpers/llm-connectors"},{"title":"Open AI","sidebarTitle":"Open AI","mode":"wide","href":"/developer-docs/helpers/llm-connectors/open-ai"},{"title":"Claude AI","sidebarTitle":"Claude AI","mode":"wide","href":"/developer-docs/helpers/llm-connectors/claude-ai"},{"title":"Azure Open AI","sidebarTitle":"Azure Open AI","mode":"wide","href":"/developer-docs/helpers/llm-connectors/azure-open-ai"},{"title":"Llama","sidebarTitle":"Llama","mode":"wide","href":"/developer-docs/helpers/llm-connectors/llama"},{"title":"Mixtral","sidebarTitle":"Mixtral","mode":"wide","href":"/developer-docs/helpers/llm-connectors/mixtral"},{"title":"Gemini","sidebarTitle":"Gemini","mode":"wide","href":"/developer-docs/helpers/llm-connectors/gemini"}]}]},{"group":"Self-Hosted Deployment","icon":"server","pages":[{"title":" Self Hosted Config","mode":"wide","href":"/developer-docs/self-hosted-config"},{"title":"Rate Limiting Configuration","sidebarTitle":"Rate Limiting","icon":"gauge","mode":"wide","href":"/developer-docs/rate-limiting"},{"title":"License Key Validation for Self-Hosted App","sidebarTitle":"License Key Validation for Self-Hosted App","mode":"wide","href":"/developer-docs/license-key-validation-for-self-hosted-app"},{"title":"Self-Hosted Deployment Verification","sidebarTitle":"Deployment Verification","mode":"wide","href":"/developer-docs/deployment-verification"},{"title":"Self-Hosted Health Checks \u0026 Probes","mode":"wide","href":"/developer-docs/self-hosted-health-checks"},{"group":"Observability \u0026 Monitoring","pages":[{"title":"Observability Setup","href":"/guides/observability-setup"},{"title":"SigNoz Integration","href":"/guides/signoz-integration"},{"title":"Datadog Integration","href":"/guides/datadog-integration"},{"title":"New Relic Integration","href":"/guides/newrelic-integration"},{"title":"Grafana Cloud Integration","href":"/guides/grafana-cloud-integration"},{"title":"Honeycomb Integration","href":"/guides/honeycomb-integration"},{"title":"Elastic APM Integration","href":"/guides/elastic-apm-integration"},{"title":null,"href":"/guides/kloudfuse-integration"}]}]},{"group":"Solution Patterns","icon":"lightbulb","pages":[{"title":"Dashboard for Multiple Clients","sidebarTitle":"Dashboard for Multiple Clients","mode":"wide","href":"/developer-docs/solutions-alchemy/dashboard-for-multiple-clients"},{"title":"Dashboards for Client Groups","sidebarTitle":"Dashboards for Client Groups","mode":"wide","href":"/developer-docs/solutions-alchemy/dashboards-for-client-group"},{"title":"Embedding: Role based Dashboard Filtering","sidebarTitle":"Embedding: Role based Dashboard Filtering","mode":"wide","href":"/developer-docs/solutions-alchemy/embedding-role-based-dashboard-filtering"},{"title":"Localized Currency Symbols","sidebarTitle":"Localized Currency Symbols","mode":"wide","href":"/developer-docs/solutions-alchemy/localized-currency-symbols"},{"title":"Manage Metrics","sidebarTitle":"Manage Metrics","mode":"wide","href":"/developer-docs/solutions-alchemy/manage-metrics"},{"title":"Custom Fiscal Year filter setup in DataBrain","sidebarTitle":"Custom Fiscal Year filter setup in DataBrain","mode":"wide","href":"/developer-docs/helpers/options/custom-fiscal-year-filter-setup-in-databrain"},{"title":"Timezone Handling in Guest Token","href":"/developer-docs/solutions-alchemy/guest-token-timezone"}]},{"group":"Testing \u0026 Debugging","icon":"bug","pages":[{"title":"Troubleshooting Guide","icon":"wrench","mode":"wide","href":"/developer-docs/testing/troubleshooting"},{"title":"Error Codes Reference","mode":"wide","href":"/developer-docs/reference/error-codes"}]},{"group":"Migration \u0026 Legacy","icon":"clock-rotate-left","pages":[{"title":"Quick start","sidebarTitle":"Quick start","mode":"wide","href":"/guides/metric-component-upto-version-V0.11.15/quickstart"},{"title":"Embed using iFrame (Not Recommended approach)","sidebarTitle":"Embed using iFrame (Not Recommended approach)","mode":"wide","href":"/developer-docs/embed-using-iframe-not-recommended-approach"}]},{"group":"Additional Resources","icon":"book","pages":[{"title":"Get an auth token","sidebarTitle":"Get an auth token","mode":"wide","href":"/guides/integrating-plugin/get-an-auth-token"},{"title":"Get an guest token","sidebarTitle":"Get a guest token","mode":"wide","href":"/guides/integrating-plugin/get-a-guest-token"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/developer-docs/helpers/api-reference/token"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/product-changelog"}]}]},"basePath":"","title":"Tenancy Model - Databrain","deploymentId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","buildId":"dpl_DyXGnKeCjZyA3sUdfMJ7FjkdBefg","dynamics":[],"chunks":[]}