CouchDB Basics

Why CouchDB?

Here is a visual guide to NoSQL systems:

alt text

You can see that CouchDB has picked availability and partition tolerance. This diagram also gives you a good big picture view of how different NoSQL databases fit in the CAP triangle.


Here is the installation instructions for Mac using the Apache CouchDB native application.

1) Download from Apache website:
2) Unzip the file.
3) Move the unzipped 'Apache CouchDB' to Applications folder.

Run CouchDB

Click on the 'Apache CouchDB' application in the Applications folder. It will open the CouchDB admin interface in the browser http://localhost:5984/_utils/. We will play with Futon admin web interface later. For now, let's interact with CouchDB from a terminal using Curl command.

Welcome CouchDB


List All Databases

$curl -X GET

Create a Database

$curl -X PUT
$curl -X GET

If you create a database that already exists:

$curl -X PUT
{"error":"file_exists","reason":"The database could not be created, the file already exists."}

Delete a Database

Let's create a new database called wave, view all the databases and delete the new database wave.

$curl -X PUT
$curl -X GET
$curl -X DELETE
$curl -X GET

Futon Interface

Go to http://localhost:5984/_utils/ URL in a browser. Click 'Verify Installation' link. Follow the quick tour. The only difference is that this version of CouchDB will show you _rev only after you save the document.

The web interface has changed for this version of CouchDB, so you will not be able to follow the instructions for 'Running a Query using MapReduce'. However you will be able to follow the instructions for 'Triggering Replication'.

The beam.smp process was using 80% of CPU and my MacBook Pro fan was spinning loudly with lot of heat from the laptop. Just go to activity monitor and kill the beam.smp process your laptop will get back to normal within a few minutes. I had to kill two beam.smp processes that had taken over most of the CPU time. After killing both processes, since CouchDB was still running it created a new beam.smp process that did not create any problems. I was able to interact with CouchDB.


I found CouchDB easy to install and play with it from a terminal. It uses a standard HTTP verbs to interact with the CouchDB server. It would be a great fit for developing your own ESCAPE server for serving configuration information. CouchDB picks availability and partition tolerance. Since consistency is not issue for this type of applications, it's a great fit.


1) Installation on Mac OS X
2) CouchDB Definitive Guide
3) Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation by Jez Humble and David Farley
4) Diagram from Stack Exchange
5) Runaway applications can shorten battery runtime, affect performance, and increase heat and fan activity

Related Articles

Ace the Technical Interview

  • Easily find the gaps in your knowledge
  • Get customized lessons based on where you are
  • Take consistent action everyday
  • Builtin accountability to keep you on track
  • You will solve bigger problems over time
  • Get the job of your dreams

Take the 30 Day Coding Skills Challenge

Gain confidence to attend the interview

No spam ever. Unsubscribe anytime.