Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-2679

Use 0x00 Get operation when getting the whole document

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 3.1.0
    • 3.0.6
    • library
    • None
    • 1

    Description

      Currently, all calls to CouchbaseCollection.GetAsync are being sent to the server as 0xd0 SubDoc Multi Lookup operations, regardless of the values in the projection list.

      Following the RFC, the request is altered based on the number of projections requested. If no projections are requested or if more than 16 projections are requested, then the SDK requests the entire document body. However, it still does so using a 0xd0 SubDoc Multi Lookup operation.

      I believe that in both of these cases (0 projections or >16 projections) a 0x00 Get operation should be issued instead. In particular, a 0xd0 request bypasses any Snappy compression. The document is decompressed on the data node, placing all decompression CPU load on the data node and increasing the required network traffic.

      Note that there may be other cases where 0xd0 is required. For example, the Java SDK also sends a subdoc operation if the options have an expiry. https://github.com/couchbase/couchbase-jvm-clients/blob/cf4c15033ed50d1d22e518e8b895fe4a29deb08f/java-client/src/main/java/com/couchbase/client/java/AsyncCollection.java#L267

      Info

      Note: as of today, the compression difference isn't really a factor since the .NET SDK doesn't support compression. However, I'm working towards a system that will allow cross-platform Snappy support.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            btburnett3 Brant Burnett
            btburnett3 Brant Burnett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty