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

NoSQL taxonomies


There are many different categories of NoSQL database. A broad definition of NoSQL might consider everything from XML databases to cloud-based BLOB storage as parts of the NoSQL landscape. However, in practice only a few NoSQL databases are widely used, with the vast majority of developer mind share belonging to only two categories, key/value and document stores.

Key/value stores are popular because of their simplicity. Records are stored and retrieved via a key much like programmers use hash tables or dictionary structures to store data in the memory. These systems tend to be highly performant.

Document stores are arguably the most popular of NoSQL databases, driven primarily by the flexibility they offer. Documents are typically stored in a JSON or JSON-like structure. JSON, being a notation for describing object graphs, is a natural fit for object-oriented applications.

While nearly all popular NoSQL databases fall into one category or another, Couchbase is both a key/value and a document store. Records are written to and read from Couchbase using a key/value API. When those records are stored as JSON documents, Couchbase provides document indexing, allowing queries on arbitrary properties in the document structure.

Importantly, Couchbase does not sacrifice features to achieve its duplicity. Though it might seem that such a hybrid system would necessarily be lacking in either its key/value or document capabilities, Couchbase feels complete. As a key/value store, Couchbase offers a rich API based on its Membase heritage. As a document store, Couchbase supports the most important features from its "pure document relative" — CouchDB.

Two data storage models also provide developers with a great deal of flexibility. Applications may be optimized using different approaches for different features; for example, a social game might make use of Couchbase's key/value interface to achieve scaling when collecting or serving vast amount of data. That same application could then use the document interface to retrieve aggregate statistics on players.