1, database connection is a time-consuming operation, the connection pool allows multiple operations to share a connection.
2, the basic idea of database connection pool is to establish a "buffer pool" for database connection. Put a certain number of connections in the buffer pool beforehand, and when you need to establish a database connection, simply remove one from the buffer pool, and then put it back when you have finished using it. We can prevent the system from endlessly connecting to the database by setting the maximum number of connections to the connection pool. More importantly, we can monitor the number and usage of database connections through the connection pool management mechanism, and provide the basis for system development, testing and performance adjustment.
3, connection pooling is used to improve the management of database connection resources