views:

182

answers:

5

I have a .NET client that needs to connect to a remote SQL Server over the WAN, is it possible to compress SQL traffic between the client and the server?

I am using .NET 3.5 and SQL Server 2005 and greater.

+1  A: 

I don't think there is compression implemented in SQL server connection - if you are in need of compressing data, you should use web service and HTTP compression when communication with the service.

Axarydax
+1  A: 

In this case I suggest to use web services or WCF to send the data instead of using connection to the database.

Wael Dalloul
Unfortunately it is an existing application, this type of change would mean a rewrite :(
Philip Fourie
+1  A: 

Check this out : http://www.toonel.net/tcpany.htm

Btw, I also think that SQL Server itself cannot compress trafic, but, with a network tier within application - you can do the compression there.

Sapphire
It this something that you have used before? Do you need to configure something on the server-side as well?
Philip Fourie
+1  A: 

Looking at the connectionstrings.com here for SQL Server 2008, the database providers do not have some kind of compression scheme...You may need to write a wrapper on a different port, that compresses the data, by using the front end, send the data across that port, from there, compress it, send it across to the remote endpoint, decompress it, and forward it on to the real tcp/ip port where the server is sitting on.

Usually SQL Server sits on port 1433...

Since a picture is worth a thousand words....

+--------+                                             +--------+
| CLIENT |                                             | SERVER |
+--------+                                             +--------+
  Port 1234                                          Port 1433 <+--+
     |                                                             |
     |                                                             |
     +={Module}=    <=>    TX/RX    <=>   ={Module}=  -+-----------+

The module will sit there on both ends compressing/decompressing...

To be quite honest, it sounds like there will be work involved as the Firewall's holes would have to be punctured to allow the compressed data in and out...throw in NAT/SNAT could make things complicated...

Have a look at this article that I wrote on Codeproject, that code acts as a traffic redirector and could easily be modified to use the compression/decompression scheme..

tommieb75
Great idea and nice picture ;)
Philip Fourie