Skip to content
Search

PgDog

lastmod 2026-01-31created 2025-05-084 edits

Ultra-fast transaction pooling and sharding manager for PostgreSQL

About

  • PostgreSQL transaction pooling + sharding + load balancing tool written in Rust + Tokio, efficiently managing hundreds of databases and hundreds of thousands of connections
  • A PostgreSQL-specific application layer (OSI L7) proxy that works like PgBouncer but also supports query analysis and replication
  • Easy to deploy with Kubernetes and Docker; cluster setup, load balancing, replication, and multi-shard management can all be handled in a single configuration
  • With its own logical replication management, it can scale out an existing PostgreSQL cluster through sharding without downtime

Key features

  • Load balancing
    • Distributes traffic based on PostgreSQL queries at OSI Layer 7
    • Automatically routes SELECT to replicas and INSERT/UPDATE etc. to the primary node
    • Strategies: supports round robin, random, least active connections, and more
    • Real-time health checks and automatic Failover on failure
  • Transaction pooling
    • Supports session/transaction-level pooling, similar to PgBouncer
    • Can serve hundreds of thousands of clients with a few PostgreSQL connections
  • Sharding and replication
    • Extracts the shard key by analyzing SQL and automatically forwards the query to the matching shard
    • For cross-shard queries, results are combined in memory and returned to the user as a single response
    • COPY commands are also split and processed per shard
    • Logical replication support: an existing DB can be scaled out through sharding without downtime
  • Live configuration changes
    • Uses PgBouncer-style .toml configuration; settings can be changed without a restart
    • Per-user authentication, per-database connections, and even shard information can be configured
  • Monitoring
    • Standard PgBouncer admin port + OpenMetrics support
    • Includes a Datadog integration example and dashboard

See also

Favorite site

author Zer0 sitemap