Today we are releasing version 2.0.1 of the Couchbase .NET SDK 2.0. This is a follow up release from the GA release 2.0.0 in early December of last year and largely includes bug fixes and performance improvements building on the foundation of 2.0.0.

What’s in this release?

Once again, this is largely a bug fix and performance improvement release. The biggest change is in the transport or IO layer which has been rewritten to use SocketAsyncEventArgs instead of the older asynchronous Socket API based off of the APM (Begin/End) which requires an IAsyncResult object be created for every asynchronous operation resulting in more frequent garbage collection. Each SocketAsyncEventArgs instance is pooled and reused, eliminating much of the problems with GCs. Additionally, a single contiguous fixed buffer is used for amongst all SocketAsyncEventArgs instances and lives the duration of the client’s lifetime. Expect additional improvements here in subsequent releases.

Another improvement that was made was the addition of bulk methods for removing a set of keys in parallel, for example:

            using (var cluster = new Cluster(config))
            {
                using (var bucket = cluster.OpenBucket())
                {
                    var multiUpsert = bucket.Upsert(items);
                    Assert.AreEqual(items.Count, multiUpsert.Count);
                    foreach (var pair in multiUpsert)
                    {
                        Assert.IsTrue(pair.Value.Success);
                    }

                    var multiRemove = bucket.Remove(multiUpsert.Keys.ToList());
                    foreach (var pair in multiRemove)
                    {
                        Assert.IsTrue(pair.Value.Success);
                    }

                    var multiGet = bucket.Get(multiUpsert.Keys.ToList());
                    foreach (var pair in multiGet)
                    {
                        Assert.IsFalse(pair.Value.Success);
                    }
                }
            }

In the code above, first we are adding a set of keys using the bulk Upsert method, then we are using the new Remove overload which takes a list of keys to remove the documents or values associated with them from the Couchbase Bucket, finally we are checking to see if they exist. A bit contrived, but you can imagine how this could be used in a real-world scenario.

In addition to the changes in the IO layer, the following major bug fixes are included in this release:

  • NCBC-777: Observe returns ObserveResponse.DurabilitySatisfied when CAS has changed
  • NCBC-748: Ensure PoolConfiguration is used from App.Config
  • NCBC-750: Ensure changes with Server are propagated to BucketConfig
  • NCBC-540: Ensure TTL follow rules when a TimeSpan
  • NCBC-625: Remove using breaking mono compilation

The complete release notes can be found here.

Contributions

There were several contributions made from the community in the form of Pull Requests from GitHub, filing Jira tickets, and through discussion on our forums. We would like to thank everyone who contributed in some to this release even if it was not directly through code; feedback and comments are always welcome.

How do I get it?

The packages are available on NuGet, S3, or you can pull the source directly from master using the tag “2.0.1”:

  • Get the packages here.
  • Download the binaries here.
  • Clone the repo here.

Posted by Jeff Morris, Software Engineer, Couchbase

Leave a reply