Some advanced features (sharding, mirroring) are still experimental.
Requires Rust for local development.
Optimal performance recommends 4 CPUs for default worker settings.
Key Features
Transaction poolingSession poolingMulti-threaded runtime (Tokio asynchronous)Load balancing of read queries between replicas and primaryAutomatic failover with health checksAdmin database statistics (pgbouncer and pgcat databases)Prometheus statistics via HTTP endpointSSL/TLS support for client and server connections
PgCat is a next-generation PostgreSQL pooler and proxy designed to enhance the performance, reliability, and scalability of PostgreSQL databases. It functions similarly to PgBouncer but introduces advanced capabilities like sharding, intelligent load balancing for read queries, and automatic failover. This tool is ideal for organizations and developers managing high-traffic PostgreSQL environments that require robust connection pooling, efficient resource utilization, and continuous availability.
By leveraging a multi-threaded runtime built with Tokio, PgCat efficiently utilizes multicore machines, handling a large number of connections and queries per second. It provides critical features for production environments, including transaction and session pooling, secure client/server authentication with SSL/TLS, and live configuration reloading. Its ability to automatically reroute queries around broken replicas and balance read queries across replicas and the primary server ensures high availability and optimal performance, even under heavy loads or during failures.
PgCat is particularly beneficial for large-scale applications that need to distribute data across multiple PostgreSQL instances (sharding) or mirror traffic for testing and analysis. While some sharding and mirroring features are still experimental, the core pooling, load balancing, and failover functionalities are stable and proven in production environments, serving hundreds of thousands of queries per second for companies like Instacart and PostgresML.
PgCat is a PostgreSQL pooler and proxy that provides connection pooling, sharding, load balancing of read queries, automatic failover, and mirroring capabilities. It's designed to improve the performance, reliability, and scalability of PostgreSQL databases, similar to PgBouncer but with additional advanced features.
How much does PGCat cost?
PgCat is open-source and released under the MIT license, meaning it is free to use.
Is PGCat free?
Yes, PgCat is free as it is an open-source project licensed under the MIT license.
Who is PGCat for?
PgCat is for developers and organizations managing PostgreSQL databases, especially those with high-traffic applications that require robust connection pooling, efficient load balancing, automatic failover, and potential sharding for scalability. It's suitable for environments where maximizing PostgreSQL performance and availability is critical.