Connection pooling
Establishing a connection to a database can be quite expensive. It implies the connection on the network level and handshaking, authentication, and allocating server resources for the new session. Imagine a web application that would connect to a database for each request from users, perform a query, and disconnect. It could take milliseconds, but when the number of requests is huge, in total it can take a lot of time. If these requests are processed simultaneously, it can happen that too many connections are created and the database server is overloaded because each connection consumes resources from the server, and even if the sessions do nothing, the number of them is always limited.
In web applications (and not only ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access