News for hackers. Stuff that matters.
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.