I have an application that uses JDBC to connect to Oracle 11g. Unfortunately, the machine my app is running on and the Oracle machine are connected via a somewhat low bandwidth connection. I haven't sniffed the connection, but I am pretty sure the data streaming across the connection is not compressed. For my application, I'm more concerned about bandwidth than latency.
Is there any way to tell the JDBC driver and Oracle to compress the data going through the connection? Google comes up with a lot of answers for data file compression, but I couldn't find anything about network protocol compression.
I'm using Oracle's thin driver, but if this is only supported by the OCI driver, I could switch to that. Thanks for any suggestions!
Oracle Advanced Compression provides a comprehensive set of compression features designed to reduce costs and improve performance by enabling compression for structured data, unstructured data, indexes, database backups, network traffic and for Data Guard redo.
It is designed for compressing static data, since it only works for direct path inserts, not single row insert, update and delete operations typical in OLTP systems. Create Table.
Oracle provides the following JDBC drivers: Thin driver. It is a pure Java driver used on the client-side, without an Oracle client installation. It can be used with both applets and applications. Oracle Call Interface (OCI) driver.
There are two types of compression: lossless and lossy. Lossless compression algorithms reduce the size of files without losing any information in the file, which means that we can reconstruct the original data from the compressed file.
I don't know specifics about Oracle's thin and OCI drivers. But you could use SSH tunnels to achieve compression.
Setup the connection to something like this:
$ ssh -L1521:localhost:1521 username@oracleserver_ip
Then, in your application, use localhost:1521 as Oracle's address.
To directly answer the question, the drivers (thin or OCI) have no such mechanism for compression. And since the data sent is likely in some funky binary format I'm not sure that it will compress well over SSL. Some other mechanism for improving network performance will need to be employed.
In my experience, high latency harms performance using the Oracle JDBC drivers far more than low bandwidth. (at least in the application I work on). You say you aren't worried about latency, but could you give an estimate on the latency of your low-bandwidth environment?
How big is the data you're sending? Are there BLOB columns? Are there other technologies involved, like a connection pool, or Hibernate? There are a lot of potential factors, not just if your data is being compressed.
Have you done any WAN emulation to try to isolate what is degrading your performance most? WANem is pretty easy to setup.
I've spent weeks on this problem, and 100-200ms latency hurt us much more than a 1Mbit bandwidth limitation. Hopefully you are in a different boat - compression an easier problem to solve.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With