Size limitation compressed/uncompressed

Hello,

Based on this documentation Size Limits | Couchbase Docs size limit for single document is 20 Mb.
Suppose if we are enabling snappy as default compression, may I know if that number means 20 Mb in compressed or uncompressed form…?

Thank you…

@aditputama It needs to be below the 20 MB limit when uncompressed. The documentation for the various SDKs describes this (I checked Java, Python, and Ruby pages all say the same thing, just with possibly different details of the error message):

https://docs.couchbase.com/java-sdk/current/concept-docs/compression.html

Quoting from the above:

Tip:

This size limit is enforced by Couchbase Server; in practice it will affect very few users, as most JSON documents are considerably smaller. A compressed doument of just under 20MB, which is greater than 20,971,520 bytes (20 MiB) when uncompressed, will be rejected by the server as follows:

Couchbase Server decompresses the document to check that it is valid JSON, and is correctly compressed with Snappy, and at this point measures it against max data size (20 MiB).

If the decompressed value’s size exceeds this limit, the mutation is failed with a “too big” error code (E2BIG code 3).

Therefore, where necessary, enforce document size limits in your application on uncompressed documents.

1 Like

@Kevin.Cherkauer thank you very much for your confirmation…! since in my case I can’t avoid possibility of >20Mb document size, I’m considering to compress it first using another method and store it as binary.

1 Like