More Than a Load Balancer
A Database Proxy is a process that sits between your application servers and your database server. It speaks the database wire protocol — the same binary protocol your database client library uses — which means it can read, inspect, and make decisions about SQL traffic before forwarding it.
This is the critical distinction from a generic TCP load balancer (like HAProxy in TCP mode or an AWS Network Load Balancer). A TCP load balancer sees raw bytes and forwards them blindly. A database proxy sees SELECT * FROM orders WHERE id = 42 and can decide: should I cache this? Should I send it to a replica? Should I block it?
Common database proxies by ecosystem:
| Proxy | Primary Database | Key Strength |
|---|---|---|
| ProxySQL | MySQL / MariaDB | Query routing, caching, firewall |
| PgBouncer | PostgreSQL | Lightweight connection pooling |
| AWS RDS Proxy | MySQL, PostgreSQL (RDS/Aurora) | Managed, IAM auth, failover |
| Pgpool-II | PostgreSQL | Pooling + read/write splitting |
| Vitess | MySQL | Horizontal sharding at scale |
The proxy is not a replacement for the database — it is a traffic management layer that makes the database appear more capable than it is in isolation.
Interviewers often ask: "What's the difference between a database proxy and a load balancer?" The precise answer is: a load balancer operates at Layer 4 (TCP) and forwards byte streams without understanding the payload. A database proxy operates at Layer 7 (application protocol) and parses the SQL wire protocol, enabling query inspection, routing decisions, and result caching. This protocol awareness is what enables every advanced feature a proxy provides.