If you have too many connections to your database, you should consider if your application is doing too many roundtrips to the database. You should design your database in such a way that it minimizes if not eliminate the need to do roundtrips.
Make sure your tables are properly normalized. In most cases, this is where the actual problem will be.
Always use set operation. You can use stored procedures that accept json or xml as parameters. Yo can read json and xml as table so you can do bulk insert, update or even delete(if advisable).
Output nested records as json or xml so the application wont have to call multiple queries to fetch related records
Check if your queries are optimized. Check the execution plan. Check the indexes. If the tables are not properly normalized, chances are the queries also aren't optimized and needs a lot of logic and data manipulation to come up with a result. The faster your queries execute, the sooner it can release the connection. Most cases of too many connections are due to poor query performance.
Computer engineer, speciality on cloud computing (GCP, AWS, OCI), python trying-to-be-dev, GO padawan, and podcaster at @nosomoscavernicolas Spotify | Google Podcast | dev.to | Amazon Music | Youtube
Yes, thanks a lot for your answer, totally agree with you, in fact this post is if didn´t work with the best practices and you are in a trouble because your db cannot receive connection. It is a great comment thanks!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
If you have too many connections to your database, you should consider if your application is doing too many roundtrips to the database. You should design your database in such a way that it minimizes if not eliminate the need to do roundtrips.
Yes, thanks a lot for your answer, totally agree with you, in fact this post is if didn´t work with the best practices and you are in a trouble because your db cannot receive connection. It is a great comment thanks!