Metabase database routing for a database per customer: when a single dashboard set is worth it
Database routing lets one set of Metabase dashboards serve many customer databases that share the same schema. You build questions once on a router database, and each person's query runs against a destination database chosen by a user attribute. The person sees their own data, while the dashboards, collections and saved questions stay in one place. On Metabase, routing is available on the Pro and Enterprise plans, so it is a licensing decision as well as an architecture decision.
Teams choose routing over row-level filters when the isolation requirement is physical, not logical. If a customer's contract, data residency rule or audit scope requires that its rows sit in a separate database, filtering a shared table is harder to defend than pointing the query at that customer's database. Teams choose it over separate Metabase instances when they want one dashboard set to maintain, one upgrade path and one place to review content. The trade-off is that every destination must keep the same schema, so a column added for one customer must be added for all of them. Confirm with your data team how schema drift is detected today, because routing does not check it for you.
Before you commit, check the features routing turns off. Routing does not work on ClickHouse, Oracle, Spark SQL or Vertica, and it cannot be combined with writable connections, editable tables, actions, CSV uploads or model persistence. Also decide what a user without a valid routing attribute should see. Under Metabase's behavior, a non-admin without a value cannot view the question, and an admin without a value sees the router database, which may expose data you did not intend to show. Review the Metabase database routing documentation against your database engines and your required features before you pick this design.
How a routed query reaches the right database
The flow starts when a Pro or Enterprise user signs in with a routing user attribute. Metabase reads that value and runs the question, which is built on the router database, against the destination database with the same schema that matches the value. Two branches matter most: admins without a value see the router database, and non-admins without a valid value are blocked from viewing the question. Check both branches in testing before go-live.
Routing by user attribute, with the admin fallback and the blocked non-admin branch.
Which components a routing design needs
A database routing setup has a small number of moving parts: one router database, one destination database per customer, a user attribute that picks the destination, and the shared content built once on the router. Each part has to match the others, so the design fails quickly if any one of them drifts.
The router database
The router database is the Metabase database connection that questions and dashboards are built against. Its schema is the reference that every destination must match, and its own data should be treated as a template rather than a live customer dataset. Admins without a routing value see this database, so decide early whether it holds anything sensitive. Confirm which team owns its connection and credentials.
Database routing docsDestination databases
Each destination is a separate database that holds one customer's data and must have the same schema as the router. A column added on one destination but not the others will break saved questions for that customer. Ask who provisions new destinations, how schema changes are rolled out to all of them, and how a missing or extra table is detected before users notice it.
Naming and schema consistency
Destination names and the attribute values that point to them must follow one naming convention, so a typo in a user record cannot route someone to the wrong database. Assign one owner for the naming rules and one for schema drift checks. Illustratively, a value such as acme_prod should map to exactly one destination, and the mapping should be reviewed whenever a customer is added or removed.
The user attribute
A user attribute on each Metabase account carries the value that selects the destination. Users without a valid value cannot view routed questions, so the attribute must be populated before access is granted. Decide whether it is set by hand, from SAML or JWT, or through another identity source, and confirm who is allowed to change it, since that person controls which customer data a user sees.
Routing docsShared questions and dashboards
Questions and dashboards are built once on the router and then reused for every customer, which keeps the content in one place. The trade-off is that the same definitions run against every destination, so a change to a shared metric affects all customers at once. Plan a review step for content edits and confirm which collections and users may modify the shared items.
Routing-disabled features
Routing cannot be combined with writable connections, editable tables, actions, CSV uploads or model persistence, and it is not supported on ClickHouse, Oracle, Spark SQL or Vertica. Check these limits against your data stack and your planned features before choosing this design, because a team that later needs uploads or persisted models will have to change the architecture.
How routing fits different customer data layouts
When every customer has its own database but all of them sit on one database server, routing is the most direct fit. Each customer database has the same schema, the router database holds the shared dashboards and questions, and a user attribute decides which destination a person's queries reach. The server is a shared failure and capacity domain, so one customer's heavy queries can slow others, and the database users Metabase connects with must be scoped so that no account can reach a customer database it should not see.
- Naming and attribute values: Decide how the attribute value maps to a database name, and whether that mapping lives in the identity provider or in Metabase.
- Schema parity: Confirm that every destination database has the same tables and columns, because routed questions fail or return wrong results when they do not.
- Connection scope: Ask whether one database user can read all customer databases, and whether a per-customer user is practical at your volume.
- Capacity: Ask the database team how concurrent dashboard traffic from many tenants will load the shared server.
- Trade-off: Compared with row security, routing isolates data at the database level, which is easier to explain to auditors, but it adds one database per customer to provision and maintain.
Before building, confirm the database naming convention, the schema parity process and the server capacity plan with the team that owns the server.
When customer databases run on different hosts, regions or accounts, the routing design must account for network paths, credentials and data residency. Routing still sends a question to one destination database, but the connections are separate, so each host needs its own network rules, secrets and monitoring. Separate hosts are often chosen for contractual or residency reasons, and that choice tends to matter more to reviewers than the routing mechanics themselves.
- Connection inventory: List every host, port and credential, and decide where each secret is stored and rotated.
- Network reachability: Confirm that the Metabase instance can reach every host from its own network, including any firewall or private link rules.
- Residency constraints: Ask whether a customer's data may be queried from a Metabase instance located outside its region, since the query path and logs may cross that boundary.
- Operational ownership: Identify who patches, backs up and monitors each host, because a routing failure may originate on any one of them.
- Trade-off: Separate hosts give the strongest physical separation, but each added host increases connection management and the chance that one customer's outage shows up as an unexplained dashboard error.
Before building, confirm the residency requirements and connection inventory with your data owners and network team.
Routing assumes that every destination database has the same schema. In practice, customers often receive custom columns, renamed tables or later migrations, and the shared questions built on the router database can break or silently return partial results. Drift is the main reason routing projects stall after the first few customers, so the schema question has to be answered before anyone builds dashboards.
- Drift inventory: Compare each customer database's schema against a reference and record every difference, including column types and nullability.
- Migration process: Decide who applies schema changes, and whether they are applied to every destination database in the same release.
- Verification: Test a representative set of shared questions against each destination database after every change, not only after the first build.
- Alternative designs: If drift is widespread, consider row security or impersonation on a single database, which tolerates differing databases less well but avoids routing failures.
- Trade-off: Routing gives clean isolation when schemas match, but drift turns that isolation into ongoing test and migration work.
Before building, ask for a complete schema comparison across all customer databases and a named owner for schema changes.
Routing configuration options and when each fits
This table compares the main configuration choices for database routing: the attribute that drives routing, how the router database is set up, how admins without a value are handled, and whether to route dashboards or single questions. Read each row against your tenancy model, and treat the constraints column as the cost of each choice.
| Decision | Option | When it fits | What it constrains |
|---|---|---|---|
| Routing attribute | Tenant or customer ID user attribute | Each person belongs to exactly one customer database and the ID maps directly to a database name | Every user needs the attribute set correctly, and a wrong value sends queries to the wrong database |
| Routing attribute | Region or environment attribute | Databases are split by geography or deployment rather than by customer | Customers spanning regions need multiple values, which the design must plan for |
| Router database name | Dedicated empty router database | You want a clear place for dashboards that holds no customer rows | Requires a schema-matched destination for every value, so the router needs a stable structure |
| Router database name | Router that also holds shared reference data | Lookup tables are common to all customers and should appear everywhere | Shared tables must be copied or mirrored into every destination, which adds sync work |
| Admins without a value | Admins see the router database | Platform admins need to build and test content without a customer context | Admins may see a schema-only or empty view, so test what they actually get |
| Admins without a value | Require a value for all users | Strict isolation is needed and no one should query outside a customer database | Support and content owners must be assigned a test value to view routed questions |
| Scope of routing | Route whole dashboards | Most dashboards are built on the same questions and all content should follow the customer | Dashboards must be built from questions compatible with routing, so ad hoc features may be limited |
| Scope of routing | Route individual questions only | Only a few sensitive questions need per-customer data and the rest can stay on the main database | Mixed routing paths are harder to review, and each question needs its own check |
Setting up database routing step by step
This sequence takes a Metabase instance from a confirmed Pro or Enterprise plan to a set of shared dashboards that show each person only their own customer database. Each step ends with a check you can run before moving on.
Confirm plan, edition and driver support
Confirm with your Metabase account team or the pricing page that your instance runs a Pro or Enterprise plan, since database routing is not available on the open source or Starter plans. Then check that every database involved is not ClickHouse, Oracle, Spark SQL or Vertica, because routing does not support those drivers. Done means you have a written note of the plan, the driver of each database and the list of questions you will build, so no later step depends on an unsupported driver. Confirm the exact behavior for your version in the database routing documentation before you commit.
Verify the router and destination schemas match
Have the data engineering or database team confirm that the router database and every destination database share the same schema, meaning the same table names, column names and data types. Routing sends the same question to a different database, so any drift breaks the question for some customers. Check the schemas with a diff tool or a catalog query on each side. Done means the diff shows no differences, and you have recorded who owns the schema and how changes will be applied to every destination.
Connect the router and destination databases
Add the router database and each destination database to Metabase as separate connections, using read-only database users created for Metabase. Keep the router as the connection that people will query, and keep the destinations as connections that only routing reaches. Run a sync on each connection and confirm that tables appear with the same names. Done means each connection shows a successful sync and a sample query returns rows from the expected database, which you verify by comparing a known record in each.
Set the user attribute source
Decide where the routing value comes from: an attribute you set by hand on each user, or an attribute passed through SAML or JWT from your identity provider. Use the same attribute name and value format for every user, and document the mapping of each value to a destination database. Manual setup suits a small, stable group, while identity provider attributes suit a large or changing population. Done means you have a table that maps every attribute value to exactly one destination, and one test user shows the expected value in their profile.
Enable routing on the router database
In the admin settings for the router database, turn on database routing and select the user attribute that chooses the destination. Map each attribute value to the connection that holds that customer's data. Save the configuration and confirm that the setting shows the attribute name and the destination list. Done means the routing settings save without error and the destination list matches the mapping table from the previous step, with no value left unmapped.
Build questions once on the router database
Create the saved questions and dashboards once, on the router database, not once per customer. Because routing runs each question against the destination chosen by the user attribute, you do not duplicate content. Avoid features that routing disables, such as writable connections, editable tables, actions, CSV uploads and model persistence, and check each question's data source before publishing it. Done means the dashboards are saved in a collection your team owns, and a review confirms that none depends on a disabled feature.
Test with a non-admin, an admin and an unmapped user
Sign in as three test users: a non-admin with a valid attribute value, an admin with no attribute value, and a non-admin with no valid value. The first should see only the data in the destination their value selects, which you confirm by comparing row counts with the destination database. The admin without a value should see the router database. The user without a valid value should be unable to view the question at all. Done means each of the three results matches what the documentation describes, and you record the outcome in your test log before any customer uses the dashboards.
Which drivers and features routing rules out
Which database drivers does Metabase database routing not support?
Database routing does not support ClickHouse, Oracle, Spark SQL or Vertica. If any of your analytics databases use these drivers, routing cannot send those queries to per-customer destinations, so the design has to change for that data. Check every connection in the Admin settings, not only the ones your dashboards use today, because a question built on a router database can point at any connected source. Routing also needs a router database and destination databases with the same schema, so a mixed estate with one of these drivers usually needs a second pattern for those tables. Confirm current driver support in the database routing documentation before you commit, since the list can change between releases.
Can I use database routing with a writable connection in Metabase?
No. Database routing cannot be used with writable connections, so a connection that allows writes cannot take part in a routed design. This matters when a team has set up a write-enabled connection for transforms, uploads or actions and wants routed dashboards on the same data. Keep routed analytics on read-only connections, and move any write workload to a separate connection that sits outside the routing setup. Your database administrators should confirm that the read-only user on each destination database has no write privileges, because the Metabase setting alone does not change what the database role allows.
Which Metabase features stop working when database routing is on?
Routing cannot be combined with several features that write to or change data in Metabase. These are editable tables, actions, CSV uploads and model persistence. Each one depends on writing to a database connection, so a routed question cannot use them. Teams that rely on editable tables for lightweight data entry, or on actions for workflow steps, need to decide whether those features move to a non-routed connection or to a different tool. Review every dashboard and saved question on the router database before enabling routing, because a feature that is off by design will break the user's view rather than fail quietly.
How do I find routing conflicts in an existing Metabase instance?
Start with an inventory of connections and their drivers, then list every feature that writes data. Work through these checks:
- Open each database connection in the Admin settings and record its driver.
- Flag any connection using ClickHouse, Oracle, Spark SQL or Vertica.
- Check whether writable connections, editable tables, actions, CSV uploads or model persistence are enabled.
- Review saved questions, models and dashboards on the candidate router database for dependencies on those features.
- Ask data owners which content uses the write features, since the instance settings do not show every dependency.
Record the results in a written conflict list, so the design decision rests on evidence from your own instance.
What happens to a user who has no routing attribute value?
A non-admin user without a valid routing attribute value cannot view the question at all. Admins without a value see the router database instead, which can expose data or confuse testing if the router holds a different dataset. This behavior affects onboarding, because a new hire whose attribute was never set will see an empty or blocked dashboard rather than an error that explains the cause. Test the attribute mapping for every identity source before you roll out routing, and decide who is responsible for keeping attributes current when people change customers or teams.
What should I use instead of routing for unsupported drivers or disabled features?
The alternative depends on what is blocking routing. For unsupported drivers, consider a separate Metabase collection or instance per data source, or moving the affected data into a supported database that holds the per-customer schemas. For write features, keep editable tables, actions and uploads on a dedicated connection and run routed analytics on a read-only one. Row and column security or impersonation can cover some isolation needs on Pro and Enterprise plans, but they do not replace routing in every case, so test each option against the same user attributes. Choose the design after the conflict list is complete, and confirm plan requirements in the pricing page before you assume a feature is available.
Can DeployOpen review an instance for routing conflicts and plan the alternative design?
DeployOpen can review a self-hosted Metabase instance for routing conflicts as part of planning the permissions model. The work typically covers the connection inventory, the list of write-dependent content, the user attribute mapping and a written recommendation on routing or another isolation pattern. The effort depends on the number of connections, how much content depends on write features and how many identity sources feed attributes. Most engagements are fixed-scope, so scope, deliverables and timelines are agreed in writing before work starts, and the quote follows from that scope. Ask for the conflict list and the alternative design as named deliverables in the proposal.
Security and operational risks of routed data
Database routing moves access control from row filters into which database a query reaches, so a mistake in attribute values, schemas or credentials changes what people can see. The cards below cover the failure points to design for before the first routed question goes live.
Missing or wrong routing attribute
A non-admin without a valid routing attribute value cannot view a routed question, so a typo in a customer identifier or an empty value from the identity provider blocks access rather than exposing data. Admins without a value see the router database instead, which is a different outcome to test. Check how each attribute is populated, from SAML, JWT or manual entry, and test one user per customer plus one with a blank value.
Database routing docsRouter database contents reaching admins
Admins without a routing value land on the router database, so whatever that database holds is visible to them. If the router contains rows for several customers, the admin view is effectively a cross-tenant view. Decide whether the router should be empty, hold only a template schema, or hold data that admins are already allowed to see, and verify what an admin sees when they open the routed question.
Schema drift across destinations
Routing assumes each destination database has the same schema as the router. When one customer database gets a renamed column, a new type or a missing table, the routed question fails for that customer only, and the failure may surface late. Plan a schema comparison step in every migration or release that touches customer databases, and run the routed questions against each destination after changes.
Credential scope on each destination
Each destination database connection needs a read-only user limited to its own data, so a misrouted query cannot reach another customer's tables through a broader credential. Confirm the database user on every destination has read privileges only, that none can reach sibling databases, and that secrets are stored and rotated under your normal process. Do not assume routing protects data that the connection itself can read.
Audit visibility of routed queries
Routing changes which database a query runs against, so audit records must show the destination as well as the user and question. Check what the instance logs for each query, whether the destination name is recoverable from those logs, and how you would prove, for a given customer, which queries touched that customer's database. Confirm this with a test query before relying on it for an access review.
Unsupported features and disabled functions
Routing does not work on ClickHouse, Oracle, Spark SQL or Vertica, and it cannot be combined with writable connections, editable tables, actions, CSV uploads or model persistence. Teams that planned any of these for routed data need a different design before build starts. Verify the feature list against your current Metabase version and your data sources.
Questions teams ask before routing customer databases
How much does it cost to route queries to a database per customer in Metabase?
Database routing is a Pro and Enterprise feature, so the software cost starts with that plan. The Metabase pricing page lists Pro at $575 per month, or $517.50 per month billed yearly, with the first 10 users included and additional users at $12 per month. Enterprise is priced by quote starting at $20,000 per year. Your total also includes the infrastructure to run Metabase, the database work that makes each customer database share one schema, and any implementation scope agreed with a partner. Ask for each of these as separate line items in a quote, and confirm which costs recur each year.
Why does the effort depend on schema consistency?
Routing runs one question built on a router database against a destination database that must have the same schema, so every customer database needs matching tables, columns and data types. If customer databases have drifted apart, each difference means a dashboard question may fail for some customers, and the fix is usually in the schema or the models, not in Metabase. Before scoping, inventory how many databases exist, how often their schemas change, and who owns each change. Teams with a migration tool that applies the same changes everywhere usually need less rework.
Where does the user attribute come from, and how much work is that?
The routing value is a user attribute, so the effort depends on how that attribute is set. Entering values by hand in Metabase is quick for a few users but does not scale and is easy to get wrong. Setting attributes from SAML or JWT login claims moves the source of truth to your identity provider, which is usually better for review, but it needs identity provider configuration and a clear naming convention. Confirm who owns the attribute, how it changes when someone moves customers, and whether your identity provider can send it on every login.
Can our internal team build database routing without a partner?
Yes, if your team already runs Metabase, understands its permissions model and can manage the Pro or Enterprise plan. The configuration is a set of Metabase settings, but the harder parts are the schema alignment across customer databases, the attribute pipeline and the test plan, which span data engineering and identity work. Check whether the people who own those areas have time for the work, and whether anyone has built a routing setup before. A partner is most useful when the schema drift is large or the team needs an outside review of the design.
What does a DeployOpen engagement need from our team?
DeployOpen works inside your infrastructure, so the work needs access to your Metabase instance, your application database, your identity provider and read access to a representative set of customer databases. You will need to name a Metabase administrator, a person who owns the customer data model, and someone who can approve changes to the identity provider configuration. Engagements are fixed-scope, so the written scope should list which databases, attributes and dashboards are included before work starts. Ask the partner to confirm each access need in writing.
Which databases can Metabase route queries to?
Routing does not work on every driver. Metabase's documentation says database routing is not supported on ClickHouse, Oracle, Spark SQL or Vertica. Routing also cannot be combined with writable connections, editable tables, actions, CSV uploads or model persistence. If your customer databases run on one of the unsupported engines, or your dashboards depend on any of those features, the design needs to change before you commit. Confirm the driver and feature list against the Metabase database routing documentation for your version.
How should we test that each customer sees only their own data?
Test with real Metabase accounts, not only admin sessions, because admins without a routing value see the router database rather than a customer database. Build a test matrix with one non-admin user per customer and one user with no attribute value. A non-admin without a valid value should not be able to view the question at all, so confirm that behavior directly. Then compare each dashboard's results with the expected figures in the matching customer database, and repeat the tests after every schema change or identity provider update.
What does routing turn off that our dashboards might rely on?
Routing disables writable connections, editable tables, actions, CSV uploads and model persistence for the routed questions. Dashboards that depend on any of these will stop working or need a different design. Inventory your existing content before enabling routing, and decide which questions stay on a non-routed connection. Keep in mind that a question with no valid routing value for a user is hidden from that user, so a dashboard can look empty rather than broken.
How DeployOpen works on this
DeployOpen plans, implements, tests, documents and supports self-hosted Metabase inside your own infrastructure, including the router database, destination databases and user attribute design that database routing needs. Engagements are fixed-scope, so the routing design and its tests are agreed in writing before the build starts.
How we scope
- Inventory which databases are per customer and confirm each one shares the same schema before routing is designed.
- Confirm the driver for every destination database, since ClickHouse, Oracle, Spark SQL and Vertica do not support routing.
- Agree the user attribute source, its values and the expected behavior for users without a value in the written scope.
- Confirm your plan, since database routing requires Metabase Pro or Enterprise, and quote the work from that written scope.
How we build
- Configure the router database and destination connections in your infrastructure, with credentials held outside the Metabase UI where your policy requires it.
- Build shared dashboards and questions once on the router database, then verify each routed destination returns the expected data.
- Check which features routing disables, such as writable connections, editable tables, actions, CSV uploads and model persistence, and plan alternatives.
- Test edge cases, including non-admins with no routing value and admins who see the router database, against documented behavior.
How we hand over
- Document the routing configuration, user attribute conventions, destination database inventory and the test cases used for each person.
- Provide a runbook for onboarding a new customer database, including schema checks and the attribute value to assign.
- Walk your administrators and analysts through the routing model, its limits and the features it turns off.
- Record the verification results so your security and compliance teams can review who sees which data.
How we support
- Support is available as a retainer for routing changes, new destination databases and Metabase upgrades that affect routing.
- Retesting after each Metabase upgrade or schema change keeps routed dashboards returning the intended data.
- Confirm with your Metabase plan and your own environment before relying on routing for a new data source.

