Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unix socket connection to MySql with Java to avoid JDBC's TCP/IP overhead?

Is it possible to make a Unix socket connection to MySql with Java to avoid JDBC's TCP/IP overhead?

Does anyone know a library (or a few libraries, perhaps) that makes this possible?

like image 567
Ollie Glass Avatar asked Sep 22 '10 16:09

Ollie Glass


1 Answers

Also the mySQL JDBC driver has been polished over a long period and has several optimization tweaks , like caching of metadata. I would be surprised that the JDBC developers would have left a lot of TCP/IP overhead in the driver.

Going over JNI to the C based implementation would probably cost more in jumping to native code than can be gained from reduced TCP/IP overhead.

If you really want to cut out the TCP/IP overhead you might consider using an embedded database like sqlite, derby or hypersonic.

like image 61
Peter Tillemans Avatar answered Oct 26 '22 18:10

Peter Tillemans