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

View writing guidance


There are some design considerations that you need to keep in mind while writing views. These guidelines will help you maintain views efficiently.

Couchbase updates all views that are in the same design document at the same time. This will result in increased index building time and high disk I/O operations. You can design by grouping frequently used views into a separate design document. However, you can improve the overall performance of views by grouping views into smaller numbers of design documents.

You should avoid too much computing in one view; it will affect performance of the view. If your view is complex, it will consume CPU resources while performing rebuilds of indexes. Whenever you require a reduce function, ensure that you use built-in reduce functions, which are optimized, instead of using custom reduce functions, which can hamper performance. You must also make sure that you verify the existence of the attribute before using it in the view logic, since...