Back to services

pgdog

PostgreSQL connection pooler, load balancer and database sharder.

View alternatives to pgdog
Suggest edit
Open source
Self-hostable
AGPL-3.0
Recent reviews

Alternatives

Tech stack

No tech stack added yet. Sign in to suggest some

Note: We were unable to fetch content from the official website this time. The information below was compiled from publicly available sources, so please refer to the official website and documentation for specific details.

Overview

PgDog is an open-source PostgreSQL proxy that sits between your application and your database, providing connection pooling, load balancing, and sharding so that PostgreSQL can scale horizontally. It is written in Rust by Lev Kokotov, the developer of PgCat, and can be seen as a next-generation approach to scaling PostgreSQL.

Key Features

  • Connection pooling: Supports transaction-level pooling, allowing many client connections to share a small number of database connections. This reduces connection pressure on PostgreSQL and serves a purpose similar to PgBouncer.
  • Load balancing: Distributes read queries across multiple replicas, with health checks and automatic removal of failed nodes to improve availability.
  • Sharding: Parses SQL and routes queries to the appropriate shard based on the sharding key. Cross-shard queries are supported, and applications need few or no code changes.
  • Wire protocol compatibility: Implements the PostgreSQL protocol, so existing clients and ORMs can connect directly.

Target Users and Use Cases

  • High-concurrency web applications with many connections that need connection pooling
  • Teams that need read/write splitting and want to spread traffic across multiple replicas
  • Teams whose single-node PostgreSQL has hit capacity or performance limits and who want to shard horizontally
  • Users looking for an alternative to PgBouncer, PgCat, Citus, or similar solutions

Core Strengths

  • Written in Rust for high performance and memory safety
  • Connection pooling, load balancing, and sharding in a single component, for a simpler architecture
  • Transparent to applications, with low migration cost
  • Open source and self-hostable

Deployment

PgDog can be built from source (the Rust toolchain is required) or deployed with Docker, and on Kubernetes it can be installed with a Helm chart. Configuration is typically written in TOML files (such as pgdog.toml and users.toml), which define the backend databases, replicas, shards, and users.

Technical Requirements

  • PostgreSQL as the backend database
  • Runtime environment: Linux or a container environment

Notable Points

  • Open-source license: AGPL-3.0
  • Under active development. Sharding-related features are still being improved, so please consult the official documentation before using it in production