Company
Date Published
Author
Jeff Morris, Senior Software Engineer, Couchbase
Word count
2782
Language
English
Hacker News points
None

Summary

Couchbase Server has introduced the Sub-document API in its Developer Preview for version 4.5, providing a more efficient way to handle document mutations by allowing changes to specific parts of a document rather than the entire document. This feature is designed to optimize performance, especially for large documents or in scenarios with slow network conditions, by only sending and modifying the specific fragment that is changed. The API supports a variety of operations, such as mutations on nested elements, arrays, and dictionaries, as well as retrieval operations for JSON fragments. It offers a fluent interface with two types of builders: one for mutations and one for lookups, allowing for the chaining of multiple operations on a document, which are then executed atomically. However, this API is currently in an early Developer Preview stage, meaning it has not undergone full testing and should not be used in production environments, as its interfaces may change based on user feedback. The release notes for version 2.2.6 also highlight several bug fixes and improvements unrelated to the Sub-document API.