A newer version of this documentation is available.

View Latest

Batching Operations

    Batching operations allows you to make better utilization of your network and speed up your application by increasing network throughput and reducing latency. Batched operations work by pipelining requests over the network. When requests are pipelined, they are sent in one large group to the cluster. The cluster in turn pipelines responses back to the client. When operations are batched, there are fewer IP packets to be sent over the network (since there are fewer individual TCP segments).

    You can batch operations via the other Couchbase SDKs (see the dropdown menu above to access their docs). Batching operations — done either via explicit multi methods, or by scheduling multiple operations in sequence — are an alternative in many of the other SDKs, but Node.js is an asynchronous language. Since the user is free to dispatch as many operations as they wish, which will be in parallel implicitly, there is no need to batch operations. In fact, if you schedule several asynchronous operations at the same time, then they will be performed at the same time, as the SDK effectively batches them internally.