In software engineering, a connection pool is a cache of database connections maintained so that the connections can be reused when future requests to the database are required. Connection pools are used to enhance the performance of executing commands on a database. Opening and maintaining a database connection for each user, especially requests made to a dynamic database-driven website application, is costly and wastes resources.
In connection pooling, after a connection is created, it is placed in the pool and it is used over again so that a new connection does not have to be established. If all the connections are being used, a new connection is made and is added to the pool. Connection pooling also cuts down on the amount of time a user must wait to establish a connection to the database.
Hence potential benefits of connection pooling
- Performance. Connecting to the database is expensive and slow. Pooled connections can be left physically connected to the database, and shared among the various components that need database access. That way the connection cost is paid for once and amortized across all the consuming components.Creating prepared statements is also expensive for some drivers, and the connection pool can cache statements for a connections across requests
- Diagnostics. If you have one sub-system responsible for connecting to the database, it becomes easier to diagnose and analyze database connection usage.
- Maintainability. Again, if you have one sub-system responsible for handing out database connections, your code will be easier to maintain than if each component connected to the database itself. Also maintaining many idle connections is expensive for a database management system, and the pool can optimize the usage of idle connections (or disconnect if there are no requests).
These are genuinely impressive ideas in concerning blogging. You have touched some fastidious things here. Any way keep up wrinting.
Thanks for every other informative website. Where else may just I am getting that type of information written in such an ideal manner?
I’ve a project that I’m simply now operating on, and I’ve been on the
look out for such info.