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

Couchbase administrative REST API


Another way to administrate Couchbase clusters is by using the REST API. It provides all the features we have discussed in the web console. In fact, the REST API is being used behind the scenes for most of the options displayed in the web console. You can perform all administrative functionalities using the REST API too.

You need some REST API tools to use this feature. In our case, we will use curl. It can be downloaded and installed from http://curl.haxx.se/download.html.

We will see an example as follows. You can refer the Couchbase documentation for comprehensive details on the REST API usages and syntax:

curl -u Administrator:root123 http://localhost:8091/pools/default

This command provides cluster details in a JSON document.

The REST API output

You can get information about a specific bucket that is LearningCouchbase using the following command:

curl -u Administrator:root123 http://localhost:8091/pools/default/buckets/LearningCouchbase

You need to pass...