Skip to main content
Updated October 11, 2026 Every Raff PostgreSQL database comes with a connection pooler (PgBouncer) in front of it. Apps connect to the pooler, which shares a small number of server connections between many app connections. That lets serverless functions and busy apps open hundreds of connections without exhausting the database.

How it works

The pooler runs in transaction mode: an app connection gets a server connection for one transaction, then gives it back. Between transactions, the next statement may run on a different server connection. The plan sets both limits, for example 25 direct and 200 pooled connections on the 1 GB plan. See Plans and sizing.

When to use it

Use the pooler by default. Use direct for:
  • Schema migrations (Prisma Migrate, Rails, Django, Flyway): many tools need one session for the whole migration.
  • LISTEN/NOTIFY, advisory locks held across transactions, SET that should last for the session, temporary tables.
  • pg_dump, psql sessions and other admin work.

Trade-offs

  • Session state does not survive between transactions on the pooler: SET, temporary tables and session-level prepared statements belong on the direct address.
  • Some drivers use prepared statements by default. With Prisma, add pgbouncer=true to the pooled URL; most other drivers work as they are.
  • A common setup: DATABASE_URL on the pooler for the app, DIRECT_URL on port 5432 for migrations.

Connect to a database

Both addresses, ready to copy.

Plans and sizing

Connection limits per plan.
Last modified on October 11, 2026