You are previewing Getting Started with CouchDB.

Getting Started with CouchDB

Cover of Getting Started with CouchDB by MC Brown Published by O'Reilly Media, Inc.

Chapter 3. CouchDB Basics

Before you start using the CouchDB API, you need to think about the basic processes of accessing the CouchDB server, and how you perform the basic commands and operations that make up your interaction.

For this chapter, we are going to concern ourselves with the basic layout, structure, and how to communicate and exchange the basic information to and from the server.

On that note, it is worth restating that CouchDB works entirely through the HTTP-based CouchDB REST API. That means that if you have an application or environment that can talk HTTP (and many can), you can communicate through the CouchDB API. The interaction is entirely based around the HTTP protocol and the path and data that you supply, either as part of the URL specification or as HTTP payload data.

In this context, HTTP is ideally suited to the database interactions because it supports many of the same basic operations in a database (Create, Retrieve, Update, and Delete) and can be directly mapped to the HTTP protocol operations of PUT, GET, POST, and DELETE.

The URL component of the HTTP request is important within CouchDB in that it is used to identify individual components (databases, documents, other components) within CouchDB. More on this later in the chapter.

Looking at everything without seeing it in action would be difficult, so let’s look at some basic interactions that you might typically perform with your CouchDB database.

Using Futon

Futon is a native web-based interface built into ...

The best content for your career. Discover unlimited learning on demand for around $1/day.