Book Image

Learning Couchbase

By : Henry Potsangbam
Book Image

Learning Couchbase

By: Henry Potsangbam

Overview of this book

This book achieves its goal by taking up an end-to-end development structure, right from understanding NOSQL document design to implementing full fledged eCommerce application design using Couchbase as a backend. Starting with the architecture of Couchbase to get you up and running, this book quickly takes you through designing a NoSQL document and implementing highly scalable applications using Java API. You will then be introduced to document design and get to know the various ways to administer Couchbase. Followed by this, learn to store documents using bucket. Moving on, you will then learn to store, retrieve and delete documents using smart client base on Java API. You will then retrieve documents using SQL like syntax call N1QL. Next, you will learn how to write map reduce base views. Finally, you will configure XDCR for disaster recovery and implement an eCommerce application using Couchbase.
Table of Contents (12 chapters)
Index

Indexes


You have understood what a MapReduce program is and how it is used to create views in the Couchbase cluster. A view helps us to retrieve or search for a document by attributes of the document other than the document ID. In a database terminology, which is called an index, that enables to fetch documents using some look up mechanism, indexes help to search for a document in an efficient manner. As discussed earlier, MapReduce allows to create views/indexes on documents that is stored locally on each node. Index creation occurs in parallel in each node within the cluster. Finally, when clients query views, the results from all nodes are combined and provided to clients. Indexes and views are optimized for search and aggregations, which will be performed in the reduce function. The output of the map function is stored in a B-tree format, to enable fast retrieval. Whenever you want to fetch documents using attributes of documents, you can create views, which in turn will create indexes...