Before you start
This tutorial is for web application developers interested in creating database-driven applications using nothing but HTML, CSS, and JavaScript. You should know how to write JavaScript and how to manipulate the Document Object Model (DOM) of an HTML page using JavaScript. You should also have some experience using a library tool, such as jQuery or Dojo.
Apache CouchDB is an open source document-oriented database management system that stores data as JSON objects. Traditional database systems allow you to perform data retrieval and update functions using a series of SQL statements that are executed through some form of proprietary client software or API. Apache CouchDB is different — you send your queries or updates using a RESTful HTTP API, making it simple to communicate with Apache CouchDB in virtually any modern programming language.
Because of the architecture Apache CouchDB is built on, it is actually possible to build entire web applications that reside inside an Apache CouchDB database. We call these applications CouchApps. CouchApps allow you to create full database-driven applications using nothing but HTML, CSS and JavaScript. The beauty of these apps is that they allow you to take full advantage of Apache CouchDB's powerful replication features to replicate your CouchApp across Apache CouchDB instances. This allows you to keep your CouchApp on several devices, and synchronize them, with automated incremental replication keeping your data up-to-date on each device.
In this tutorial, you will learn how to create your own CouchApp using HTML, CSS, and JavaScript. Your application will perform database operations using Ajax powered by the jQuery framework. The application you will build is a contact manager that allows you to view, create, edit, and delete your contacts. Finally, you will learn how to replicate this application between two Apache CouchDB instances.
You will need the following tools to follow along with this tutorial:
- An Apache CouchDB database instance, v1.0.1 or higher
- The CouchApp tool, version 0.7.0 or higher
See Resources for download information and Downloads for the source code of our sample application.




