News for hackers. Stuff that matters.
Re:Understanding Connections and Pools by toredash on Tuesday January 05, 2021 @02:51PM (#25650116)
Am I reading this correctly, that with NodeJS and PostgreSQL, the usage of multiple connection poolers _combined_ is a not-so-good idea?

Example, using Knex as the connection pooler for your node app, which is connected to your PgBouncer deployment?

I have not considered this a fault, in one way I find it compelling to have a layer of "protection" by using Knex in addition to PgBouncer, but not I'm not that sure anymore.

Re:Understanding Connections and Pools by sudhirj on Tuesday January 05, 2021 @03:03PM (#25650290)
It depends on how knex is used. If it gives you a method to run a DB query, and internally checks out a connection, runs the query and releases the connection, then it’s already doing exactly what would happen with a proxy.

If it or you are setting up middleware to start a transaction before every request, or put a checked out connection in the request context, that’s a lot of possible inefficiency. If you really want the convenience this offers, and have request flows that do a lot of other non-DB work, you’ll need a pooling proxy.

If your request handling is very database heavy and does nothing else, then automatic request level connection check out is still efficient, even without a proxy. Even if you have a proxy one real connection is going to be working the entire duration of the request anyway.

Re:Understanding Connections and Pools by toredash on Tuesday January 05, 2021 @03:40PM (#25650727)
Thanks for the feedback. I have some reading to do and some code to checkout.