Our architecture:
We have multiple app instances running on k8s -> a total of 8 NestJS applications and using typeorm for all DB side of things. It seems we can pass max to extra option of Datasource https://github.com/typeorm/typeorm/issues/3388#issuecomment-673242516. That is passed down to node-postgres the underlying library for postgres connection.
Question:
- If our connection pool size is 20 do those 20 connections are shared between 8 apps or do we get a total of 160 connections?
- What are the best practices for setting pool size limit?