Skip to main content

Neon Connection Pooling & pgBouncer

When running multi-instance MTVL deployments or serverless frontends, connection management is critical to prevent Postgres connection exhaustion.

Direct vs. Pooled Connection Strings

Neon provides two distinct connection endpoints for every database branch:

Best Practices for MTVL with Neon

  1. Use Pooled DSN for Backend API: Set DB_DSN with -pooler for runtime API instances.
  2. GORM Connection Pool Tuning: Configure GORM connection pool limits inside Go to match your workload:
  1. Always enforce SSL: Keep sslmode=require enabled in all connection strings.