Book Image

Couchbase Essentials

Book Image

Couchbase Essentials

Overview of this book

Table of Contents (15 chapters)
Couchbase Essentials
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Asynchronous operations


One of the primary reasons for the growth of Couchbase is its massive scalability. Few databases come close to the performance offered by Couchbase Server. Any system that is capable of handling millions of operations per second across a small cluster of nodes will have to deal with concurrency issues at some point.

Traditionally, servers dealt with concurrency by spinning up threads to handle multiple requests simultaneously. However, as load increases on such systems, the overhead of creating and maintaining threads becomes quite expensive in terms of CPU and memory.

Couchbase Server makes use of nonblocking I/O libraries to provide scaling, without the need to spin a thread or process every request. In a nutshell, nonblocking I/O makes heavy use of asynchronous callbacks to avoid blocking the receiving thread.

In other words, the thread that receives the request will only delegate the work to be done, and later receive a notification when that work is done. This pattern...