How to Integrate Looker and Vitess Safely

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair looker and vitess to run fast analytics on large relational datasets. Looker sends SQL queries to Vitess clusters, which route them across sharded MySQL nodes. This setup lets analysts build charts from live data. Yet it also opens paths to production tables if you do not set strict rules. How looker and vitess share data and permissions Looker speaks the standard MySQL protocol when it talks to a Vitess cluster. The Vitess query router takes each request and checks the user key a

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 looker and vitess to run fast analytics on large relational datasets. Looker sends SQL queries to Vitess clusters, which route them across sharded MySQL nodes.

This setup lets analysts build charts from live data. Yet it also opens paths to production tables if you do not set strict rules.

How looker and vitess share data and permissions

Looker speaks the standard MySQL protocol when it talks to a Vitess cluster. The Vitess query router takes each request and checks the user key and password. Then the router parses the SQL and sends it to the right database shards. Once the shards return rows, Vitess merges the results and sends them back to Looker.

In most setups, Looker uses one database user to log in to Vitess. You create this user inside the Vitess auth config and grant it read permissions. Looker holds those login keys in its admin storage and reuses them for every dashboard run. Because Vitess scales across many nodes, one bad query from Looker can hit many shards at once.

You can tell Vitess to route Looker queries only to read replica tablets. This step keeps heavy chart loads away from primary nodes that handle customer writes. Good routing keeps your core app fast while analysts explore large tables.

Common risks with shared accounts and broad permissions

The biggest risk in this pairing comes from one shared database account. When ten analysts run charts in Looker, Vitess sees all ten queries from one user. Your database logs will not show which person ran an expensive or risky query. This blind spot slows down audits and makes it hard to fix bad reports.

Broad read roles create a second major risk for engineering teams. If the Looker account can read every keyspace, analysts might query raw customer tables. Those tables often hold sensitive fields like emails, phone numbers, card numbers, or national IDs. Without field masking to rewrite matched fields in results, raw personal data flows into charts.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Network exposure adds one more failure mode to watch out for. Many teams host Looker in the cloud while Vitess runs in a private network. Opening public firewall ports so Looker can reach Vitess exposes your cluster to outside traffic. Instead, teams should use private network links or SSH tunnels with strict IP rules.

Best practices for scoping roles and queries

Start by creating a dedicated Vitess user just for your Looker instance. Grant this user read permissions only on the specific keyspaces and tables needed for reports. Never reuse the same database user that your core backend app uses for writes.

Next, set up Vitess tablet types so analytical traffic hits read replicas or batch nodes. Primary tablets should only serve live app traffic and critical writes. You should also set query timeouts and row limits inside Vitess to stop runaway joins.

Finally, pass user context from Looker into your queries whenever you can. Adding comments or tags to SQL helps your team trace which chart caused a spike. Pair those tags with clear database logs and data masking rules for sensitive columns. This keeps customer emails and card numbers safe while giving analysts the metrics they need.

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

How does Looker talk to a Vitess cluster?

Looker connects to Vitess using the standard MySQL driver and protocol. Vitess acts like a single MySQL server and routes queries to the underlying shards.

Should Looker query primary Vitess tablets?

No, you should route Looker traffic to replica or read-only tablets. This protects your primary nodes from slow analytical joins that could block app writes.

How can we protect sensitive fields in Vitess from Looker users?

Scope the database role to clean views and use data masking on sensitive fields. Masking rewrites matched fields like emails, phone numbers, and card numbers in query results.

The query runs. The emails stay hidden.