Should I use PgBouncer or pgpool-II for a single PostgreSQL server?
Use PgBouncer. It's simpler, lighter, and provides 97.5% connection reduction with 53% throughput gain. pgpool-II is overkill for single-server setups.
Can I use Prisma with PgBouncer?
Yes—this is the recommended setup for production. PgBouncer handles database-level pooling; Prisma provides ORM features with fewer connections. Set Prisma's connection_limit lower when using PgBouncer.
What pool size should I start with?
Use the formula: (core_count * 2) + spindle_count. For a 4-core server with SSD, start with 8 connections. Monitor and adjust based on actual load.
Does connection pooling help with serverless functions?
Yes, but use Prisma Data Proxy or PgBouncer with persistent instances. Serverless functions create many short-lived connections, which poolers handle efficiently.
What's the difference between session and transaction pooling modes?
Session mode holds connections until client disconnects (safest for apps using temp tables). Transaction mode releases connections after each transaction (recommended for most apps, 10x more efficient).