NCache 4.6 - 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 its disabled. Its default value is "False", as compression is disabled by default for all caches.
threshold: Items greater than the value specified in the threshold attribute will only be compressed/decompressed at client side (or sometimes at server side) if compression is enabled.
 
What does Compression do?
 
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 to objects of a size less than the specified threshold value, and they will travel via the network and will be stored in the cache in their original sizes.
 
Where does Compression Occur?
 
Compression/decompression mostly occurs at client side, but there are few cases when the NCache server is engaged in the compression/decompression of the data.
 
Client side compression/decompression
 
This takes place if NCache compression is enabled, and if any of the following cases occurs:
 
  • For data with size greater than the threshold being sent by the client to a remote server, data is compressed by the client and sent to the cache server in compressed form. Cache servers just store the data without applying any compression to it.
  • If a client requests for compressed data in cache from the server, the cache server does not apply any decompression to the data and sends the data in its compressed form over the internet. The client receives the compressed data and decompresses it by itself.
 
Server side compression/decompression
 
This takes place if NCache compression is enabled, and any following case occurs:
 
  • For the data being loaded via Cache Loading and Read-Through 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 data received by the cache server in compressed form, which has to be written to a data source via configured Write-Through or Write-Behind provider, NCache server decompresses the data first before sending it to the data store.
 
 
See Also