---
title: "Data isolation methods"
description: "Compare the ways Metabase can restrict data access for internal analytics or multi-tenant setups, including row and column security, impersonation, database routing, and locked parameters."
url: "https://www.metabase.com/docs/latest/permissions/data-isolation-methods"
version: "65"
---

> For the complete documentation index, see [llms.txt](https://www.metabase.com/docs/llms.txt).

# Data isolation methods

> Row and column security, impersonation, and database routing are only available on Metabase [Pro](https://www.metabase.com/product/pro) and [Enterprise](https://www.metabase.com/product/enterprise) plans.

Metabase offers several ways to ensure people only see the data they're supposed to see, whether you're restricting data by team for internal analytics or isolating customer data in a multi-tenant setup. The best method depends on how you store your data and where you want to enforce access rules:

- If all data lives in the same tables, use [row and column security](#row-and-column-security) to filter data in Metabase, or [impersonation](#impersonation) to enforce access rules at the database level.
- If each customer or team has their own database, use [database routing](#database-routing).
- If you're embedding dashboards for people without Metabase accounts, use [locked parameters](#locked-parameters).

You can combine these methods. For example, you can use locked parameters for a guest embed while using row and column security for signed-in users.

## Row and column security

[Row and column security](https://www.metabase.com/docs/latest/permissions/row-and-column-security.md) lets you control which rows and columns each group can see. You can define rules that filter data based on [user attributes](https://www.metabase.com/docs/latest/people-and-groups/managing.md#adding-a-user-attribute). Metabase applies your rules to questions you build in the query builder.

![Row and column security](https://www.metabase.com/docs/latest/permissions/images/row-and-column-level-security.png)

Use row and column security when:

- You need granular control over which rows and columns each group or customer can see.
- You want to manage access rules in the Metabase UI instead of in your database.

Don't use row and column security when:

- People need to write native SQL queries. Row and column security doesn't apply to the SQL editor.
- You need column-level security on MongoDB, which only supports row-level security.
- People need to run actions. People with row and column security [can't run actions](https://www.metabase.com/docs/latest/permissions/row-and-column-security.md#people-with-row-and-column-security-cant-run-actions) on that database.

## Impersonation

[Impersonation](https://www.metabase.com/docs/latest/permissions/impersonation.md) lets your database control what each person can see. You define roles and row-level security policies in your database. Metabase connects using the role specified by each person's [user attribute](https://www.metabase.com/docs/latest/people-and-groups/managing.md#adding-a-user-attribute), and your database enforces what that role can see.

![Impersonation](https://www.metabase.com/docs/latest/permissions/images/connection-impersonation.png)

Use impersonation when:

- You want to centralize access logic in your database instead of in Metabase.
- People need to write native SQL queries. Since your database enforces the rules, the rules apply in the SQL editor too.

Don't use impersonation when:

- Your database [doesn't support it](https://www.metabase.com/docs/latest/permissions/impersonation.md#databases-that-support-impersonation).
- You don't want to set up and maintain roles and policies in your database.
- You rely heavily on caching. You can't share cached results between roles.

## Database routing

[Database routing](https://www.metabase.com/docs/latest/permissions/database-routing.md) sends each person's queries to their own database. You build questions and dashboards once against a primary database, and Metabase routes queries to the right destination database based on each person's [user attribute](https://www.metabase.com/docs/latest/people-and-groups/managing.md#adding-a-user-attribute). Database routing requires that each group's data lives in a separate database, and that all destination databases have identical schemas.

![Database routing](https://www.metabase.com/docs/latest/permissions/images/database-routing-diagram.png)

Use database routing when:

- You want the strongest isolation. Each group's data lives in a separate database.
- You want to avoid one group's queries affecting the performance of another group's queries.

Don't use database routing when:

- Groups share tables. Use [row and column security](#row-and-column-security) or [impersonation](#impersonation) instead.
- You want to manage access rules in the Metabase UI instead of maintaining a separate database for each group.

## Locked parameters

[Locked parameters](https://www.metabase.com/docs/latest/embedding/parameters.md#restrict-data-on-guest-embeds) filter an embedded dashboard or question before Metabase displays it. Your app passes the filter value in a signed JWT. The filter is invisible to the person viewing the embed, and they can't change it.

![Locked parameters](https://www.metabase.com/docs/latest/embedding/images/locked-parameters.png)

Use locked parameters when:

- You want to restrict data without setting up Metabase accounts, user attributes, or permissions.
- You want to filter data without exposing the filter or its values to the people viewing the embed.

Don't use locked parameters when:

- You want account-level or role-based access control across your Metabase.
- You're working with sensitive data. Use a method that enforces access at the permissions or database level instead, like [row and column security](#row-and-column-security), [impersonation](#impersonation), or [database routing](#database-routing).

## Further reading

- [Permissions overview](https://www.metabase.com/docs/latest/permissions/start.md)
- [Tenants](https://www.metabase.com/docs/latest/embedding/tenants.md)
- [Row and column security](https://www.metabase.com/docs/latest/permissions/row-and-column-security.md)
- [Impersonation](https://www.metabase.com/docs/latest/permissions/impersonation.md)
- [Database routing](https://www.metabase.com/docs/latest/permissions/database-routing.md)
- [Locked parameters for guest embeds](https://www.metabase.com/docs/latest/embedding/parameters.md#restrict-data-on-guest-embeds)
