Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Building CouchApps

Create web applications stored in an Apache CouchDB database

Martin Brown (mc@mcslp.com), Professional Writer, Freelance Developer
Martin Brown has been a professional writer for over eight years. He is the author of numerous books and articles across a range of topics. His expertise spans myriad development languages and platforms —Perl, Python, Java™, JavaScript, Basic, Pascal, Modula-2, C, C++, Rebol, Gawk, Shellscript, Windows®, Solaris, Linux®, BeOS, Mac OS/X and more— as well as web programming, systems management and integration. Martin is a regular contributor to ServerWatch.com, LinuxToday.com and IBM developerWorks, and a regular blogger at Computerworld, The Apple Blog and other sites, as well as a Subject Matter Expert (SME) for Microsoft®. He can be contacted through his website at http://www.mcslp.com.

Summary:  Apache CouchDB is an open source document-oriented database management system that allows you to create full database-driven applications using nothing but HTML, CSS and JavaScript. In this tutorial, you will learn how to create your own CouchApp that 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.

Date:  03 May 2011
Level:  Intermediate PDF:  A4 and Letter (238 KB | 29 pages)Get Adobe® Reader®

Activity:  47136 views
Comments:  

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.

About this tutorial

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.


Prerequisites

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.

1 of 9 | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Open source, Web development
ArticleID=651098
TutorialTitle=Building CouchApps
publish-date=05032011
author1-email=mc@mcslp.com
author1-email-cc=