PgDog
PgDog is a high-performance PostgreSQL proxy that enables horizontal scaling without requiring application changes. It combines connection pooling, load balancing, and distributed database capabilities into a single lightweight executable that can be deployed anywhere—whether on Kubernetes via Helm or Docker containers. Trusted by companies like Coinbase, Ramp, and Modal, PgDog handles 2M+ queries per second and 20TB+ of sharded data in production environments.
Product Highlights
- Real Transaction Mode: Share a few PostgreSQL connections across 100,000+ clients while preserving session state, advisory locks, LISTEN/NOTIFY, and prepared statements—no connection pinning required
- Intelligent Load Balancing: Distribute reads across replicas with automatic health checks, replication lag detection, and failover handling using built-in PostgreSQL SQL parsing for maximum compatibility
- Transparent Sharding: Extract sharding keys directly from queries to route them automatically, with cross-shard transactions, parallel query execution, and support for GROUP BY, COUNT(), AVG(), ORDER BY, and other OLAP operations
- ACID-Compliant Distributed Transactions: Maintain data consistency at scale with two-phase commit, cross-shard rollbacks, replicated tables for fast joins, and automatic monotonic integer primary key generation
- Zero-Configuration Deployment: Drop-in proxy requiring no application code changes, with simple TOML configuration and compatibility with standard migration tools like Alembic and ActiveRecord
Use Cases
- High-Throughput OLTP Workloads: Scale transactional applications to millions of queries per second while maintaining PostgreSQL compatibility and session semantics
- Read-Heavy Applications: Offload SELECT queries to multiple replicas automatically, with intelligent routing that detects lag and hardware failures without manual intervention
- Multi-Tenant SaaS Platforms: Shard databases by tenant_id or any custom key, enabling horizontal growth while keeping each tenant's data isolated and queryable
- Geospatial Data Distribution: Move complex sharding logic from application code into configuration, as demonstrated by Earth Genome's 4-billion-row production deployment
- Microservices Connection Management: Replace connection-heavy service meshes with a centralized pooler that supports 50,000+ transactions per second per thread
Target Audience
PgDog is designed for engineering teams running PostgreSQL at scale who need to solve connection exhaustion, read replica management, or data sharding without refactoring existing applications. It particularly serves infrastructure engineers, database administrators, and backend developers at high-growth startups and enterprises where horizontal scalability and operational simplicity are critical priorities.