As a rule, you say that this is true, but the connection pool takes up a lot of connection overhead.
When using the connection pool, you have a collection of connections that are used when queries arrive in the database. These compounds are then recycled for later use. I explain this very poorly, but, as always, wikipedia has some good information to get you started.
http://en.wikipedia.org/wiki/Connection_pool
If you are looking for a silver bullet, for example, always use xxx, unfortunately, it is not. You will need to evaluate each scenario and make a determination there.
For example, if you have a slow connection to the database server, you probably want to cache the received data in order to minimize the number of calls you make in the database.
On the other hand, if you have a system with limited resources, calling the database can often be a valid option.
You will need to evaluate these situations for each system that you are developing in order to maximize the capabilities of your software, but with the right architecture, it is usually quite easy to adapt the system to any constraints that you encounter.
source share