Hello, I have 1.3.10.0 couchbase client version and 4.6.2 couchbase server version. I want to put my couchbase client version upgrade, but now I find couchbase1.3.10 client version stored data is a binary format, and the new version 2.4.0 defaults to json format, by looking at the source, found the new and old client version storage format of completely different, the new version cannot be carried out on the old version of the data stored for compatibility. I would like to know how 1.3.10.0 is smoothly compatible with upgrading to the new couchbase client version and compatible with getting data from the current 1.3.10.0 version. And I found that the response time of 2.4.0 to retrieve and store data from couchbase4.6.2 was slower than that of 1.3.10.0 client, but 1.3.10.0 client was no longer compatible with couchbase server version 5.0.0 and above. I hope you can tell me how to solve these problems. Can I upgrade my couchbase client version and then upgrade my couchbase server version
Hi @lijie -
v1 1.3.x actually can store as a binary blob or as JSON, it really depends upon which method you call. Since you were using the methods that stored as binary objects, you can make use of the BinaryToJsonTranscoder to handle this case:
var config = Utils.TestConfiguration.GetCurrentConfiguration();
config.Transcoder = () => new BinaryToJsonTranscoder(config.Converter(), config.Serializer());
using (var cluster = new Cluster(config))
{
using (var bucket = cluster.OpenBucket())
{
var result = bucket.Get<dynamic>("user_1");
}
}
Note that the cluster and bucket would be global level in a real application - created when the app starts up and destroyed when the apps shuts down.
I wouldn’t bother with v2.4.0 as it was released more than 2 years ago and there have been dozens of releases since then. Jump to the latest, v2.7.10, which was released in July of 2019! There are hundreds of bugs and improvements released since 2017.
-Jeff