Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I use connection pooling?

I am writing a ETL project in JAVA. I will connect to the source database, get the data only once, do some transformations and Load the data to a target database.

The point is that I am not connecting to the source or the target database multiple times repeatedly. I just connect once (using JDBC), get the data I need and close the connection.

Should I still use the connection pooling?

Thank you for your views!

like image 339
ajay Avatar asked Dec 28 '25 16:12

ajay


1 Answers

Connection pooling is used to get around the fact that many database drivers take a long time to create a connection. If you only need to use it shortly, and then discard it, the overhead might be substantial (both in time and cpu) if you need many connections. It is simply faster to reuse than to create a new.

If you do not have that need, there is no reason to set up a connection pool if you don't have it already. If you happen to have one already, then just use that.

like image 113
Thorbjørn Ravn Andersen Avatar answered Dec 30 '25 04:12

Thorbjørn Ravn Andersen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!