How to Integrate Metabase and Vitess Safely

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair metabase and vitess to run fast charts on huge MySQL clusters. This setup lets staff query sharded data through a simple web app. Metabase turns user clicks and questions into standard SQL queries. Vitess takes those queries and routes them across many MySQL shards. Together, they help teams explore massive tables without writing complex code. Yet linking a business app to a core cluster brings real security risks. How data and permissions flow between metabase and vitess Metabase

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams pair metabase and vitess to run fast charts on huge MySQL clusters. This setup lets staff query sharded data through a simple web app.

Metabase turns user clicks and questions into standard SQL queries. Vitess takes those queries and routes them across many MySQL shards. Together, they help teams explore massive tables without writing complex code. Yet linking a business app to a core cluster brings real security risks.

How data and permissions flow between metabase and vitess

Metabase speaks the standard MySQL wire protocol when it queries a database. Vitess uses a stateless router component to accept these incoming MySQL queries. When an analyst opens a dashboard, Metabase sends a SQL query out. The Vitess router reads that query and finds the right data shards. Each shard holds a slice of the table on a MySQL instance. Vitess gathers the rows from each shard and combines the results. Then it sends the final table back to the Metabase web app.

Logins between the two tools rely on database user accounts and passwords. You set up a database role inside the Vitess user list. Then you save those login keys inside the Metabase admin panel. Metabase uses this single account for every chart and user query. It pools connections so dashboards load fast for the whole team. You can also turn on TLS to encrypt data in transit. This stops outsiders from reading data as it moves across the network.

Common failure modes and how to scope roles

The biggest risk in this setup comes from one shared service account. Every Metabase user runs queries through that same database login key. When fifty people run reports, Vitess sees one single user name. Database logs cannot show which person ran a slow or risky query. If an attacker steals that shared password, they gain full access. Even worse, some teams give this account write rights by mistake. A bad query could change or delete live data across all shards.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Unbounded queries create another big problem for sharded database clusters. An analyst might build a chart that scans every shard at once. Cross-shard joins and full table scans eat up CPU and memory. A few heavy reports can slow down your live customer app. Sensitive data leaks are also a major risk for growing teams. Raw tables often hold private emails, phone numbers, and card numbers. Without field controls, any chart builder can pull those private records.

You can fix many of these issues with strict role rules. First, give the Metabase database user read-only rights on specific schemas. Never use an admin account or a write role for reporting tools. Second, route reporting traffic to replica tablets instead of primary tablets. Vitess lets you target read-only replicas so reports never block live writes. This keeps your main customer app fast when analysts run big jobs. Third, lock down the network path between the two tools. Place both systems in private subnets and use strict firewall rules. Only allow the Metabase server IP to reach the Vitess router port. Finally, set row limits and query timeouts on the Vitess side. These limits kill runaway queries before they crash a database shard.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.

Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

How does Metabase talk to a Vitess cluster?

Metabase uses its built-in MySQL driver to talk to the Vitess router. Vitess acts like a single MySQL server and handles shard routing.

How do we stop Metabase reports from slowing down live traffic?

Point the Metabase database role at Vitess read-only replica tablets. This keeps heavy analytical scans away from your primary write nodes.

How can we protect private fields in Metabase charts?

Restrict the database role to clean views or use dynamic data masking. Masking rewrites matched fields like emails, phone numbers, and national IDs in results.

The query runs. The emails stay hidden.