Company
Date Published
Author
Mark Nunberg, Software Engineer, Couchbase
Word count
2063
Language
English
Hacker News points
None

Summary

The Sub-Document (subdoc) API feature allows efficient access to parts of documents without transferring the entire document over the network. This reduces bandwidth usage and increases overall throughput. The subdoc API is implemented as part of the KV service in Couchbase, providing a high-performance set of simple APIs for accessing data within a single document. Subdoc operations can be used to perform lookups, mutations, and counter operations on documents, with options such as creating parents, handling CAS, and managing durability requirements. The subdoc API is designed to reduce network bandwidth and increase throughput, making it suitable for use in applications where efficient data access is critical. The API is atomic, ensuring that all sub-commands operate on the same version of the document, and can be used with N1QL queries when all Document IDs are known. However, the API does not support multi-document operations, and its naming convention may not conform to some programming languages' conventions.