Prior to setting up my DigitalOcean managed database cluster I was just using a local PostgreSQL database. I was using the node-postgres (https://node-postgres.com/) package to create a connection pool. I would create one connection pool instance and import that instance into my serverless functions to query the database. However, with the DigitalOcean managed database cluster it is recommended to use the built-in connection pool tool (which uses PgBouncer according to documentation). My question is if I use the DigitalOcean connection pool should I not use a connection pool through node-postgres? Currently I have a connection pool set up through node-postgres in my Next.js web application and a connection pool set up through DigitalOcean. I am not sure if this “double pooling” is bad practice or will cause issues. Thanks and let me know if I need to provide more info.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.