How to Integrate Superset and Vitess Safely

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair superset and vitess to build live dashboards on large MySQL clusters. Superset sends read queries through Vitess routing nodes to fetch chart data. This setup lets analysts explore big tables while Vitess splits the load across shards. You must set up strict roles and network rules to keep data safe. How data and roles flow between superset and vitess Superset acts as the web app where staff build charts and run SQL. Vitess sits in front of many MySQL shards and looks like one dat

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 superset and vitess to build live dashboards on large MySQL clusters. Superset sends read queries through Vitess routing nodes to fetch chart data.

This setup lets analysts explore big tables while Vitess splits the load across shards. You must set up strict roles and network rules to keep data safe.

How data and roles flow between superset and vitess

Superset acts as the web app where staff build charts and run SQL. Vitess sits in front of many MySQL shards and looks like one database. When a user opens a dashboard, Superset connects to the Vitess query router.

Superset uses a standard MySQL driver to talk to the Vitess router node. You set up a database record in Superset with the router host address. Vitess checks the login key and sends the query to the right shards. The shards return rows to Vitess, which combines them for the Superset chart.

User permissions exist in two places during this data flow. First, Superset checks if the logged in analyst can view the chart. Second, Vitess checks if the database account can read the target tables. Most teams link Superset to a single service account on the Vitess side. That single account becomes a shared key for every person using the app.

Common failure modes and how to scope access

The biggest risk in this setup is an overly broad database service account. If the Superset account has write permissions, a bad query can change data. SQL Lab in Superset lets users type custom queries against the connected database. A user with SQL Lab permissions could drop tables or alter rows by mistake.

Unlogged queries create another blind spot for security and platform teams. When twenty analysts share one Vitess login, database logs show just one user. You cannot tell which person ran an expensive query or viewed sensitive rows. PII like emails, phone numbers, card numbers, and national IDs may sit in shards. Without field rules, queries return those raw values straight to the chart screen.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Heavy analytical queries can also hurt production traffic on the Vitess cluster. A full scan across all shards can slow down customer writes right away. You can fix this by routing Superset traffic only to read replica tablets. Vitess lets you target replica nodes so reporting never hits the primary writer.

You should also lock down the database account used by the dashboard app. Create a dedicated read user in Vitess that only sees specific reporting schemas. Never grant admin rights or write privileges to the account used for charts. Set query timeouts and row limits in Vitess to stop runaway dashboard loads. Keep both systems on a private network and block public traffic to routers.

Securing analyst queries in SQL Lab

Many teams split their Superset database entries into two separate database records. One record powers fixed dashboards and uses a tight, read-only database role. The second record serves ad-hoc work in SQL Lab with stricter row limits. This split helps you control who can run raw SQL against your shards.

You also need a clear audit trail for every query that hits production. Relying only on app logs makes it hard to match queries to people. Teams need a way to tie each database command to a real user. Masking rules can also rewrite emails or card numbers in the query results.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Which driver connects Superset to a Vitess cluster?

Superset connects to Vitess using a standard MySQL client driver. Vitess speaks the MySQL wire protocol, so no custom driver is needed.

How do we keep Superset queries from slowing down production writes?

Point your Superset database settings to Vitess read replica tablets instead of primaries. This keeps heavy chart queries away from the nodes that handle live writes.

Can we restrict what tables Superset users see in Vitess?

Yes, create a read-only user in Vitess with grants for specific tables only. Also use Superset role rules to limit which datasets each team can pick.

The query runs. The emails stay hidden.