Consider the mysql package. The description covers connection pooling thus,
Rather than creating and managing connections one-by-one, this module also provides built-in connection pooling using
mysql.createPool(config).
Then, there is the connection pool setting in proxysql as described here.
Similarly, in case of PostgreSQL too, there is the pg package supporting connection pooling and pgboucner pooling feature.
- How are these approaches (
npmpackage versus product supporting tools) different? - Ideally, I would like to configure connection pooling at the database level so that a developer is free from handling connections. Can this be a preferred approach?