Using the IBM Cloudant — simply explained

Aashish Chaubey
3 min readFeb 15, 2019

Hey people, this tutorial is for the ones seeking help in using the Cloudant npm package or taking this as a reference to build something using Cloudant and node. This tutorial or rather just a help document will help you learn the important Node APIs for interacting with the database.

It is one of the many blog series, you can find the link to the next blog at the bottom of the article.

Please feel free to comment on the article and let me and other readers know if there is a better way of doing things than those mentioned in the blog. That would be awesome and in fact, is one of the main purposes of writing this article.

IBM Cloudant

IBM Cloudant is a NoSQL database that is based on Apache CouchDB and the open source BigCouch project that focuses on the ease of use and scalable architecture. It is yet another Key-Value store.

Each record is not an opaque string: it’s a JSON document that the engine understands. It is a schema-less data store which does not require any prior knowledge of how its data, ‘record’, is going to be; what shall be its format. It does not impose any necessary field as such by default. It is just pure data which is JSON and has an object as the root.

IBM Cloudant is a distributed database that is optimized for handling heavy workloads that are typical of large, fast-growing web and mobile apps. It is a document-oriented database as a service (DBaaS). It stores data as documents in JSON format. It comes with a wide variety of indexing options that include MapReduce, IBM® Cloudant® for IBM Cloud Query, full-text indexing, and geospatial indexing. The replication capabilities make it easy to keep data in sync between database clusters, desktop PCs, and mobile devices.

Getting Started

There are two ways of accessing Cloudant: either locally or on the Bluemix Cloud. You can use the embedded link if you wish to install a Cloudant cluster locally for a specific project and use it as required. Or, as we will proceed in this article, a very simple way of getting an instance of Cloudant on the IBM Cloud.

For the ones who have Cloudant setup and configured, please feel free to skip this step

Creating a service instance

Using the IBM Cloud Dashboard

  1. Log into your IBM Cloud Account
  2. Select Cloudant from the Catalog
IBM Cloud Dashboard

3. Provide details in the Configuration Window
Select the Authentication method as required by your application to connect. Choose a domain and a custom service name. Select the plan as required.
We got our instance!!!

4. Click on Create in the lower right-hand side of the window!

Alternatively

Using the CLI for installing the Cloudant

IBM Cloud CLI can be found here. Download and install the CLI on your type of OS.

  1. Login to the IBM Cloud.
ibmcloud login — sso
  1. Creating the service
$: ibmcloud resource service-instance-create NAME SERVICE_NAME|SERVICE_ID SERVICE_PLAN_NAME|SERVICE_PLAN_ID LOCATION [-p, — parameters @JSON_FILE | JSON_STRING ]
Example:
$: ibmcloud resource service-instance-create cs20170517a cloudantnosqldb lite us-south -p ‘{“legacyCredentials”: false}’

where,

Field Description

Tada! Here you have your Cloudant instance setup!!

This is the first part of the many series blogs on Cloudant, please check out the other articles as well and let me know your comments if any.

Thanks!!!

--

--

Aashish Chaubey

Data Science and Machine Learning enthusiast || Passionate Computer Science Engineer || Love Analyzing || https://aashishchaubey.com