
PgDog is an open source connection pooler, load balancer, and sharding proxy for PostgreSQL. It's Postgres-compliant, fast, secure and built in the open by a community of database engineers.
PgDog is an open source connection pooler, load balancer, and sharding proxy for PostgreSQL. It's a single executable that replaces multiple database infrastructure tools, enabling you to scale Postgres horizontally without changing your application code. Built in the open by a community of database engineers, PgDog handles everything from pooling thousands of connections to distributing queries across sharded databases.
PgDog shares a small pool of Postgres connections among 100,000+ clients without breaking session state, advisory locks, or LISTEN/NOTIFY. It's multi-threaded and async, handling 50,000+ transactions per second per thread with no query length or connection limits.
The load balancer distributes reads across replicas, detects replication lag and hardware failures, and automatically moves write traffic to a new primary during failover. A built-in Postgres SQL parser enables read/write splitting without client-side changes.
PgDog extracts the sharding key directly from queries and routes them to the correct shard. Queries without a sharding key execute across all databases in parallel, supporting GROUP BY, COUNT, AVG, ORDER BY, MIN, MAX, and COPY operations out of the box.
Cross-shard transactions use native Postgres prepared transactions and two-phase commit for atomic writes across shards. Replicated tables enable fast, shard-local joins, and integer primary keys are generated automatically in the proxy. DDL is automatically applied across all shards, so migration tools like Alembic and ActiveRecord work without modification.
"PgDog doesn't trade speed for consistency. It maintains ACID compliance, at scale."
Most sharding solutions force you to choose between performance and data integrity. PgDog preserves full ACID guarantees even when transactions span multiple shards, using Postgres's own two-phase commit. This means you can scale horizontally while keeping the same transactional semantics you'd expect from a single Postgres instance.
You're running Postgres in production and need to handle more connections, distribute read traffic, or shard your database without rewriting your application. PgDog is especially valuable if you want a single, open source proxy that replaces separate connection poolers, load balancers, and sharding middleware — all while staying compatible with your existing Postgres tooling and client drivers.
Other tools you might consider
Loading comments…
Maker
kettle_dev
Project Info
Product Keywords