I have a postgres instance running on aws/rds.
No it it's a client side pool so there is no special setup on the DB server itself outside of ensuring that the number of concurrent connections on the server is enough. The defaults for RDS should be fine. Keep in mind that it's one pool per Node.JS process so if you're using something like the cluster module you'll need more connections on DB server accordingly.
If you're writing an app that's running as an AWS Lambda function then you should NOT use a pool as when the lambda freezes the pool will be invalid as the TCP socket will have died without being closed. In that situation you need to either create clients on demand or ensure that your pool shutdown at the completion of each processed request.
@sehrope when you say it's a client side pool does this mean the driver pool will check with the DB if there are available connections and if not wait for the "next slot available" so to speak?
No it won't wait for a server connection spot to open up. It will return back a server error message saying no available connections. If you want to automatically try again you'd need to have your code try that in a loop (probably with a sleep in between).
Most helpful comment
No it it's a client side pool so there is no special setup on the DB server itself outside of ensuring that the number of concurrent connections on the server is enough. The defaults for RDS should be fine. Keep in mind that it's one pool per Node.JS process so if you're using something like the cluster module you'll need more connections on DB server accordingly.
If you're writing an app that's running as an AWS Lambda function then you should NOT use a pool as when the lambda freezes the pool will be invalid as the TCP socket will have died without being closed. In that situation you need to either create clients on demand or ensure that your pool shutdown at the completion of each processed request.