- What is a connection pool and why is it important?
- A connection pool maintains a set of open database connections ready for use by the application, avoiding the overhead of creating a new connection per request. Without pooling, a high-traffic application can overwhelm the database with connection overhead alone.
- What causes 'too many connections' errors?
- PostgreSQL has a max_connections setting (default: 100). Each connection consumes ~10MB of memory. Applications without connection pooling create one connection per thread, which scales poorly. Use PgBouncer (PostgreSQL) or ProxySQL (MySQL) to multiplex connections.
- What SSL modes are available for database connections?
- Common SSL modes: disable (no SSL), require (encrypt but don't verify certificate), verify-ca (verify CA chain), verify-full (verify CA + hostname). Production databases should use verify-full; never use disable outside of local development.