Monday, 12 November 2018

node-postgres: single query vs transaction

Two questions.If I have multiple single queries and my idleTimeout is 10s, would that mean that in a given point in time, there can have many idling clients?For example, if I do db.query 3 times in a middleware with route /get-user, and 10 users goes to that route at the same time, that means that in that split second, there would be 30 active clients in that 10s timeout?If I have to do db.query 3 times (all SELECT queries) in a middleware, is it better to use a transaction?

Submitted November 13, 2018 at 12:16AM by eggtart_prince

No comments:

Post a Comment