Asynchronous Programming
Edit this article in GitHub
Version 2.2

Asynchronous Programming

The Node.js SDK supports asynchronous programming implicitly through it's use of the typical Node.js callback pattern coupled with having our underlying networking library tightly coupled to the Node.js event loop. Performing many operations asynchronously garners a huge performance benefit compared to performing operations in a serial manner. The same bucket can have hundreds of outstanding operations at any one time with minimal loss in performance compare to using a bucket serially.

In addition to the asynchronous callback pattern already exposed through the Node.js SDK, it is also possible to wrap the Node.js SDK in a promises library such as bluebird. Many of these libraries can also make couchbase available through an ES6 generator pattern.