Snappy Compression enabling and default compression


I was going through OOB code of couchbase sdk and below are the versions of core and java client. Our couchbase server is on 6.6.2.

I see that by default compression is enabled in below class.

I have few queries around this,

  1. Is this snappy compression that has been by default enabled or should we use below setting to enable snappy compression. com.couchbase.snappyEnabled=true.
  2. After snappy compression is enabled, does it mean the reads that client does gets always compressed documents?? or do we have any other setting that needs to be done for that??


@sri_ram snappy compression is enabled by default and will on KV writes decide if a document is sent compressed or uncompressed based on the min size and the min ratio. If it is sent compressed the correct flags are set and the server will store it as such.

On retrieve, depending on the server sends the document compressed or uncompressed it will detect that and perform the decompression transparently before returning it to you in the app.

It is all done transparently, no need for you to enable it.

Also, your Java SDK version is quite old - please upgrade to a newer version to get all the good bugfixes and enhancements for free :slight_smile:

1 Like

Thanks @daschl for your response,

Currently we have passive mode enabled on our bucket. From the documentation below,

Couchbase Server sends the item back to the client in compressed form if this is requested by the client; otherwise, it sends the item back in uncompressed form.

I see client can receive compressed form, so does that mean from your explanation, by default client expects a compressed document as it is enabled by default if the document is already compressed.

Also if you can please suggest any logs that we can enable to see if client received compressed or uncompressed document would really help??