I am currently working on migrating an application from Moxi to the latest Couchbase SDK. However, I am facing an issue where data written by Moxi, particularly larger values, are compressed and I am not being able to read correctly by the new SDK.
Is there a configuration or setting in the Couchbase SDK that enables automatic compression and decompression (like memcached), allowing seamless reading and writing of data while maintaining its original format?
Hi @MickaelM - I think the best solution would be to get the data from Moxi in uncompressed form and let the Couchbase SDK compress it. By default, the Couchbase SDKs will compress documents.
Mike
If your application used the SpyMemcached client to talk to Moxi, the Sdk2CompatibleLegacyTranscoder included in the modern Couchbase Java SDK might do what you want.
Note that Sdk2CompatibleLegacyTranscoder behaves differently than the standard (default) JsonTranscoder. To upsert a JSON document using the legacy transcoder, you must build the JSON string yourself, then upsert the string. Contrast this with the standard JSON transcoder, which uses a JsonSerializer to automatically convert the object you upsert into JSON.
Thanks,
David
EDIT: Oops, I just realized you posted this in the PHP SDK category, so Java sample code isnβt of much use. Sorry about that.
This was all way before my time, but I think the Moxi clients may have used plain old GZIP compression, and marked a document as compressed by setting the flag 0x02.
Let me see if we can rustle up a PHP expert who might be able to show how to do that with the modern Couchbase PHP SDK.