NCache 4.4 - Online Documentation

Data Compression

 
NCache provides data compression feature to minimize the data traffic between cluster and client nodes and also to make the limited available memory, slightly more useful by storing more data in compressed form. Compression is by default disabled in NCache. Data compression can be enabled/disabled using NCache Manager.
 
Configuring NCache Compression Settings
 
Changing NCache compression settings will change the following configurations accordingly in config.ncconf file :
 
<compression enabled="truethreshold="500kb"/>
 
This xml tag specifies whether the items greater than the specified threshold should be compressed/decompressed at client side.
 
Enabled: If this attribute is set to "True", it means compression is enabled, otherwise disabled. Its default value is "False", as compression is disabled by default for all caches.
 
Threshold: Items greater than the value specified in threshold attribute will only be compressed/decompressed at client side (or sometimes at server side) if compression is enabled.
 
What Compression does
 
Once data compression is enabled, and the required threshold via NCache Manager is specified, NCache will apply GZip Compression for all objects of size greater than the specified threshold value, providing more memory storage and minimizing network traffic.
 
Compression will not be applied on the objects of the size less than the specified threshold value They will travel via network and will be stored in the cache in their original sizes.
 
Where does Compression Occur
 
Compression/decompression mostly occur at client side, but there are few cases when NCache server does the compression/decompression of the data.
 
Client Side Compression/Decompression
 
Client side compression/decompression takes place, if NCache compression is enabled, and any following case occurs:
 
  • For the data with size greater than the specified threshold, being send by the client to a remote server, data is compressed by client and sent to cache server in compressed form. Cache server just stores the data without applying any compression to it.
  • If a client requests for a data from the server, that is stored in cache in compressed form, cache server does not apply any decompression to the data and sends the data in its compressed form over the internet.  Client receives the compressed data and decompresses it by itself.
 
Server Side Compression/Decompression
 
Server side compression/decompression takes place, if NCache compression is enabled, and any following case occurs:
 
  • For the data being loaded via configured cache startup loader or read-thru provider, and of size greater than the specified threshold, NCache server compresses the data after receiving it from the data source and before storing it in the cache.
  • For the data received by cache server in compressed form which has to be written in a data source via configured write-thru or write-behind provider, NCache server does not send the compressed data to the data source, in fact it decompresses the data first before sending it to the data store.
 
 
See Also