Answer here
As a rule, opening a connection to a database is an expensive operation, so the union maintains active connections, so when a connection is later requested, one of the active ones is used in preference to open the other.
I understand the concept of Connection Pool in database management. This is the answer to the question " what is ~ ". All developer blog posts, answers, tutorials, DB databases always answer the " what is " question. Just like they constantly copy / paste text into each other. No one is trying to explain why this is so and how . The answer given above is an example for him.
I cannot understand why and how it is possible that keeping, say, 30 open connections in a pool is less expensive for the system than opening a new one when required.
Suppose I have a web server located in Australia. And the database at AWS located in the USA, somewhere in Oregon. Or in GB. Or anywhere, but very far from AUS. So they all say that keeping a pool of 20 -... open connections will be less expensive for memory and system performance than for opening a new connection every time in this case? How can it be? Why?
database connection-pooling
Green
source share