Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Rust
  3. pgdog

pgdog

AGPL-3.0Rustv0.1.62

A PostgreSQL proxy written in Rust that provides connection pooling, load balancing, and database sharding.

Visit WebsiteGitHubGitHub
5.6k stars304 forks0 contributors

What is pgdog?

PgDog is a PostgreSQL proxy designed to scale database infrastructure through connection pooling, intelligent load balancing, and transparent sharding. It sits between applications and PostgreSQL servers, managing thousands of connections, distributing queries across replicas, and enabling horizontal scaling by splitting data across multiple database shards.

Target Audience

DevOps engineers, database administrators, and backend developers managing PostgreSQL deployments at scale, particularly those needing to improve connection efficiency, distribute read/write traffic, or implement sharding without major application changes.

Value Proposition

Developers choose PgDog for its all-in-one approach to PostgreSQL scaling, combining the connection pooling of PgBouncer with advanced load balancing and native sharding capabilities, all built in Rust for high performance and reliability.

Overview

PostgreSQL connection pooler, load balancer and database sharder.

Use Cases

Best For

  • Reducing connection overhead in high-concurrency PostgreSQL applications
  • Load balancing read queries across multiple PostgreSQL replicas
  • Implementing database sharding to scale horizontally beyond single-server limits
  • Managing failover and high availability for PostgreSQL clusters
  • Integrating AWS RDS IAM authentication with existing PostgreSQL clients
  • Orchestrating zero-downtime re-sharding operations

Not Ideal For

  • Applications heavily reliant on subqueries or common table expressions (CTEs) in a sharded setup, as cross-shard queries do not support these features.
  • Small-scale PostgreSQL deployments where the overhead of managing a separate proxy and configuration files outweighs the benefits of connection pooling.
  • Teams requiring drop-in compatibility with all PgBouncer admin tools, as PgDog's admin database is not fully compatible, favoring OpenMetrics instead.
  • Projects with stringent low-latency requirements where any additional network hop from the proxy layer is unacceptable.

Pros & Cons

Pros

High-Performance Architecture

Built in Rust with Tokio, PgDog is optimized to handle thousands of connections on commodity hardware, leveraging modern async runtime for high-throughput workloads as highlighted in the performance documentation.

Intelligent Load Balancing

Uses PostgreSQL protocol-aware routing to automatically send writes to the primary and reads to replicas, supporting strategies like round robin, random, and least active connections, which maximizes database availability.

Comprehensive Sharding Support

Supports partition-based and schema-based sharding with in-memory assembly for cross-shard queries, unique ID generation, and re-sharding capabilities via logical replication, enabling horizontal scaling without major app changes.

AWS RDS Integration

Offers RDS IAM authentication, allowing clients to use password-based auth while PgDog uses IAM tokens for backend connections, simplifying security in AWS environments.

Cons

Partial SQL Feature Support

Cross-shard queries have significant limitations: subqueries and CTEs are not supported, and aggregates, ORDER BY, and GROUP BY have only partial support, which can break complex queries in sharded setups.

Configuration Complexity

Requires managing two separate TOML files (pgdog.toml and users.toml) and detailed setup for sharding, such as defining shard mappings and enabling rewrite features, increasing operational overhead compared to simpler proxies.

AGPL License Constraints

Licensed under AGPL v3, which mandates sharing modifications if offered as a public service, potentially deterring commercial cloud providers or teams wary of open-source compliance issues.

Open Source Alternative To

pgdog is an open-source alternative to the following products:

P
PgBouncer

PgBouncer is a lightweight connection pooler for PostgreSQL that reduces the overhead of establishing new connections by maintaining a pool of database connections.

Frequently Asked Questions

Quick Stats

Stars5,585
Forks304
Contributors0
Open Issues129
Last commit1 day ago
CreatedSince 2024

Tags

#connection-pooling#high-availability#aws-rds#sharding#database-proxy#postgresql#scalability#rust#database-sharding#load-balancer

Built With

A
AWS ECS
T
Terraform
K
Kubernetes
R
Rust
T
Tokio
D
Docker

Links & Resources

Website

Included in

Rust56.6k
Auto-fetched 1 day ago

Related Projects

RustFSRustFS

RustFS is an open-source, S3-compatible high-performance object storage system supporting migration and coexistence with other S3-compatible platforms such as MinIO and Ceph.

Stars35,227
Forks1,608
Last commit1 day ago
QdrantQdrant

Qdrant - High-performance, massive-scale Vector Database and Vector Search Engine for the next generation of AI. Also available in the cloud https://cloud.qdrant.io/

Stars35,180
Forks2,769
Last commit1 day ago
SurrealDBSurrealDB

A scalable, distributed, collaborative, document-graph database, for the realtime web

Stars33,216
Forks1,393
Last commit4 days ago
TursoTurso

A SQL database in Rust: SQLite-compatible, now also speaking Postgres (experimental). The LLVM of databases.

Stars24,937
Forks1,474
Last commit1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub