Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle connection compression?

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!

like image 289
joev Avatar asked Dec 23 '09 17:12

joev


People also ask

What is Oracle Database compression?

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.

What is compressed table in Oracle?

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.

What is Thin driver in Oracle?

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.

Which of the following compression features can be used for reducing the data size?

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.


3 Answers

I don't know specifics about Oracle's thin and OCI drivers. But you could use SSH tunnels to achieve compression.

  1. So, in your Oracle machine, you setup a SSH daemon. If your Oracle server is running under RedHat Linux, you're done
  2. On your client machine (the one that hosts your application that connects through JDBC) setup a SSH connection, enabling a compressed tunnel. You can use command line SSH or Putty (if you are under windows) to do that.

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.

like image 146
Pablo Santa Cruz Avatar answered Nov 02 '22 17:11

Pablo Santa Cruz


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.

like image 20
Adam Hawkes Avatar answered Nov 02 '22 18:11

Adam Hawkes


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.

like image 5
Joshua McKinnon Avatar answered Nov 02 '22 17:11

Joshua McKinnon