How to Configure Vitess Proxy

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a vitess proxy by running VTGate nodes in front of your shards. These nodes take app queries and send them to the right MySQL instance. Most engineering teams start by sharing one broad user login across many developers. That setup makes initial testing fast for the whole team. Still, broad database permissions let any logged-in user run risky commands on live tables. A single bad query can drop data or expose customer records across every shard. How a vitess proxy routes queries an

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.

You set up a vitess proxy by running VTGate nodes in front of your shards. These nodes take app queries and send them to the right MySQL instance. Most engineering teams start by sharing one broad user login across many developers. That setup makes initial testing fast for the whole team. Still, broad database permissions let any logged-in user run risky commands on live tables. A single bad query can drop data or expose customer records across every shard.

How a vitess proxy routes queries and checks logins

Vitess uses a built-in component called VTGate to act as its main routing layer. Your apps and engineers treat this node just like a standard MySQL server. When a user logs in, VTGate checks the username and password against its user list. You can store these login records in a static file or an external store. After the login check passes, the node reads the incoming SQL statement. It looks at the keyspace and shard map to find where the data lives.

Next, the node sends the query to the matching tablet server for each shard. Each tablet runs beside a MySQL process and manages local query execution. The tablet checks its own rule list before running the query on the database. This two-step flow keeps your app code simple even when you split large tables. Engineers do not need to track which server holds a specific row of data. They just send standard SQL to the main endpoint and get a single result back.

Managing access control lists at the tablet level

To lock down tables, teams set up access control lists on the tablet nodes. These lists link specific usernames to read or write roles on matching table groups. When a query arrives from VTGate, the tablet checks the user identity attached to it. If the user lacks the right role for that table, the tablet blocks the query. This native feature helps teams split read-only apps from services that write new data.

Keeping these lists in sync across hundreds of tablets takes steady operational work. Every time a new team member joins, admins must update the central user rules. Many teams get tired of constant updates and fall back to shared role accounts. Once five engineers share one login, the audit logs lose individual user context. You can see that the shared account ran a query, but not which person typed it. Rotating passwords for shared accounts also forces teams to update every local client tool.

Database Proxy (ProxySQL, PgBouncer) + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native routing solves and where gaps remain

The native Vitess routing layer solves horizontal scaling and connection pooling very well. It stops thousands of app servers from opening direct connections to underlying MySQL nodes. It also gives admins a basic way to accept or block users at login time. Still, login checks and table lists only decide who can open a database session. They do not inspect what individual statements do in flight or mask sensitive columns.

If an engineer has read permissions on a customer table, every column comes back raw by default. Emails, phone numbers, card numbers, and national IDs appear in plain text on their screen. Likewise, a user with write permissions can run an unapproved update without a peer check. Native table rules cannot ask a manager for approval before running a single risky command. Teams need query-level controls to rewrite sensitive fields in results and check commands in flight.

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 sits inline in the wire protocol beside those services as an open-source proxy, a sidecar for your Postgres or API. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run, and hoop.dev data masking rewrites matched sensitive values in responses 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

Does VTGate replace the need for MySQL user grants?

VTGate handles client logins while tablets use a shared service account to talk to MySQL. You still need strict local grants on MySQL so only the local tablet can connect.

How do teams audit individual engineer queries in Vitess?

Teams must give each engineer a unique login in the VTGate user file or directory. If engineers share one login, the query logs cannot tie actions to a single person.

Can native Vitess table rules hide sensitive columns like card numbers?

No, native table rules work at the table level rather than the column data level. They allow or block the whole query instead of rewriting emails or card numbers in results.

The query runs. The emails stay hidden.