A cloud-native, multi-tenant Postgres connection pooler
open sourceApache-2.0self-hostablefree
Supavisor is a Postgres connection pooler from Supabase, written in Elixir, built to run as a highly available cluster that proxies very large numbers of client connections into pools of native PostgreSQL connections for many databases at once. Tenants (each a database or cluster with its users and pool settings) are kept in a Postgres database and managed through an HTTP API with an OpenAPI spec, and a pool lives on one node while clients can connect to any node, so nodes can be added, replaced or deployed blue/green without dropping the pools. It supports transaction, session and native pool modes, buffers connections briefly during database restarts and failovers, and exports Prometheus metrics. Supabase runs it as the shared pooler for every Supabase project, and it's Apache-2.0 licensed.
Problems it solves
- pool connections for hundreds of customer Postgres databases from one shared pooler cluster
- serverless functions open thousands of Postgres connections and the database can't keep up
- a connection pooler that keeps working when one of its nodes dies
- scale or restart Postgres without clients getting connection errors, by buffering them briefly
- add and remove pooler tenants through an API instead of editing a config file and reloading
- run the connection pooler on its own cluster so pooling doesn't use the database server's resources
- migrate from PgBouncer to a pooler that runs as a multi-node cluster
- see connection pool throughput per tenant and per database in Prometheus
Features
- multi-tenant: pools for many Postgres databases and clusters from one deployment
- single-tenant use as a drop-in replacement for PgBouncer
- transaction, session and native pool modes
- clustered nodes with pools found from any node; rolling and blue/green deployments
- brief connection buffering for transparent database restarts and failovers
- tenant management HTTP API with an OpenAPI spec and Swagger UI
- Prometheus /metrics endpoint with throughput by tenant, database and connection
- migration guide from PgBouncer
Limitations
- Doesn't support prepared statements in transaction mode on Supabase's shared pooler: turn them off in the client library1
Capabilities
| Has an API | plan not known |
|---|
Alternatives
The same job
These do what Supavisor does.