MariaDB Proxy
A mariadb proxy sits between your apps and your database servers to route queries. It manages traffic, pools open links, and sends read or write commands to the right node. Most engineering teams set up a database router to handle failovers and split read workloads. Still, basic routing tools often share broad database roles across many users and apps. When everyone uses the same wide role, one bad query can drop tables or expose private rows. How a native mariadb proxy routes traffic In a st
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.
A mariadb proxy sits between your apps and your database servers to route queries. It manages traffic, pools open links, and sends read or write commands to the right node. Most engineering teams set up a database router to handle failovers and split read workloads. Still, basic routing tools often share broad database roles across many users and apps. When everyone uses the same wide role, one bad query can drop tables or expose private rows.
How a native mariadb proxy routes traffic
In a standard database cluster, you have one primary writer and several read replicas. Without a router in the middle, every app must track which server holds the primary role. If the primary server fails, teams must update app settings by hand to point to a new node.
A native mariadb proxy fixes this problem by acting as a single entry point. Apps send all SQL traffic to one network address. The router inspects the incoming SQL statement to see if it changes data or just reads it. Write commands go straight to the primary server. Read queries spread out across the available read replicas to keep the cluster fast.
The router also keeps a warm pool of open database links ready for use. Opening a new TCP link and checking user keys for every single web request takes time. By reusing open links from a pool, the router lowers load on the database servers. It also watches server health in the background. When a node goes down, the router stops sending traffic to it right away.
What native routing solves and what it misses
Native database routers are built for high uptime, fast query splitting, and link pooling. They keep apps online during hardware failures and help scale read heavy workloads. For app to database traffic, this setup works well.
The gap appears when engineers, analysts, or scripts log in to run live queries. Native routing checks who can log in at the start of a session. Once that session opens, the user has the full power of their assigned database role. If an engineer logs in with a shared admin role to fix a bug, every table is open.
Database Proxy (ProxySQL, PgBouncer): architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Native routers do not inspect individual queries to block risky commands for specific human users. They also do not mask sensitive columns in the query results. If a table holds customer emails, phone numbers, or card numbers, any select query returns those raw values. Basic server logs often show only the shared pool account name, not the real person who ran the query. Teams end up choosing between locking everyone out or giving out long lived passwords with too much power.
Managing human and script sessions safely
To keep production data safe, teams need a clear split between app traffic and human queries. App servers need fast connection pooling and automatic failover across cluster nodes. Engineers and support staff need tight controls on what they can read and change during a live session.
Instead of handing out static database passwords, teams should tie database logins to their central identity provider. Every query should map back to a real user email in the audit log. Sensitive fields like national IDs and card numbers should be rewritten in the query results before reaching the user screen. High risk write commands should pause for a quick peer check before they run against production tables.
Inspect every MySQL query and response in flight
Static grants and network rules block bad logins. They cannot pause a risky query for review or mask emails in a result set. By design, hoop.dev sits inline in the MySQL protocol as a sidecar for your MySQL. For every plain query, prepared statement, or cursor an agent or human runs in production, hoop.dev decides to pass, mask, block, or hold it for review.
First, hoop.dev guardrails block banned actions before MySQL runs them, and an AI Analyzer you configure can score intent or escalate for approval. Next, hoop.dev data masking rewrites sensitive string columns in results in memory, and every verdict goes to the audit trail. Find the open-source binary on GitHub.
Frequently asked questions
What is the main purpose of a MariaDB router?
A MariaDB router directs SQL traffic to the right database server in a cluster. It splits reads and writes, pools open links, and handles server failovers for apps.
Does connection pooling hide which engineer ran a query?
Yes, standard connection pools reuse a single shared database user for many client sessions. Because of this, native database logs record the shared pool user instead of the individual person.
Can native database routing mask sensitive columns in query results?
No, standard traffic routers only forward packets between the client and the server. Rewriting sensitive fields like emails or phone numbers in live results requires a dedicated inspection tool.
Related guides
In this post