Connection pooling - NodeJS or Database products?
You can use connection pooling on any level, but I believe that it is best done with a connection pool inside the application server code for these reasons:


You don't need an extra process like pgBouncer that you have start and monitor.
You don't have any more TCP connections than necessary, thus conserving resources and being faster.


This holds if you have a single application server. If several of them access the same database, connecting pooling in the application server isn't enough. It is still a goid idea if you want to limit the DB resources each one can use, but you will still need another connection pool to limit the total number of database connections.

Such a connection pool can be implemented in the database if the RDBMS supports it (PostgreSQL doesn't), or it can be an external tool like pgBouncer.