Database Proxy
ELI5 — The Vibe Check
A database proxy sits between your app and your database like a bouncer at a club. It manages who gets in, how long they stay, and can even redirect traffic to different databases. It handles connection pooling, load balancing, and query routing so your app doesn't have to care about the messy details.
Real Talk
A database proxy is a middleware layer that intercepts connections between application clients and database servers. It provides connection pooling, load balancing across replicas, query routing, failover handling, and observability. Common proxies include PgBouncer, ProxySQL, and cloud-native solutions like AWS RDS Proxy.
When You'll Hear This
"Our database proxy routes reads to replicas and writes to the primary." / "Adding a proxy in front of Postgres cut our connection count by 90%."
Related Terms
Connection Pooler
A connection pooler keeps a stash of open database connections ready to go, like having pre-heated ovens in a bakery.
Multi-Primary Replication
Multi-primary replication lets multiple database servers accept writes simultaneously, like having multiple cashiers at a store.
PgBouncer
PgBouncer is a lightweight connection pooler that sits in front of PostgreSQL and recycles database connections like a good environmentalist.
Read Replica
A read replica is a copy of your database that only handles read queries.