What is PgDog?
PgDog is a connection pooler, load balancer and sharding proxy for PostgreSQL, written in Rust. Lev Kokotov started it in late 2024. He was previously the main author of PgCat, another Postgres pooler written in Rust. PgDog is published under the AGPL-3.0 license.
PgDog does several jobs:
- Pooling: shares a small number of Postgres connections among many clients.
- Load balancing: sends writes to the primary and spreads reads across replicas.
- Sharding: routes each query to the right database when data is split across several of them.
- Resharding: moves data between shards using Postgres logical replication.
What is PgCache?
PgCache is a transparent, wire-compatible caching proxy and smart read replica for PostgreSQL. It sits between your application and your database without requiring application code changes, and keeps its cache current through Postgres logical replication. Writes, and reads PgCache can't serve from cache, go to your database.
PgCache works with PostgreSQL 16, 17 and 18, including Amazon RDS and Aurora. It's source-available under the Elastic License 2.0.