Design Documents-CouchDB


Design documents
 are a special type of CouchDB document that contains application code. Because it runs inside a database, the application API is highly structured. We’ve seen JavaScript views and other functions in the previous chapters. In this section, we’ll take a look at the function APIs, and talk about how functions in a design document are related within applications.

This part (Part II, “Developing with CouchDB”, Chapters Chapter 5, Design Documents through Chapter 9, Transforming Views with List Functions) lays the foundation for Part III, “Example Application”, where we take what we’ve learned and build a small blog application to further develop an understanding of how CouchDB applications are built. The application is called Sofa, and on a few occasions we discuss it in this part. If you are unclear on what we are referring to, do not worry, we’ll get to it in Part III, “Example Application”.

Continue reading

Introduction to CouchApp for Ext JS Devoper

 As an Ext JS developer you’ve probably noticed your server side application code slowly reduced to a thin set of APIs shuffling data between your client-side JavaScript applications and a server side database. If you’ve been wondering how you can eliminate the server side application stack and securely communicate with a database using a RESTful API you’ll be happy to find out you can with a CouchApp!

Blue Chair Icon By Neno Mindjek

Blue Chair Icon By Neno Mindjek

Continue reading

More on CouchDB installation-party 2

Installing from Source

Generally speaking, you should avoid installing from source. Many operating systems provide package managers that will allow you to download and install CouchDB with a single command. These package managers usually take care of setting things up correctly, handling security, and making sure that the CouchDB database is started and stopped correctly by your system. The first few appendixes showed you how to install CouchDB packages for Unix-like, Mac OS X, and Windows operating systems. If you are unable to follow those instructions, or you need to install by hand for other reasons, this chapter is for you.

Dependencies

To build and install CouchDB, you will need to install a collection of other software that CouchDB depends on. Without this software properly installed on your system, CouchDB will refuse to work. You’ll need to download and install the following:

It is recommended that you install Erlang OTP R12B-5 or above if possible.

Each of these software packages should provide custom installation instructions, either on the website or in the archive you download. If you’re lucky, however, you may be able to use a package manager to install these dependencies.

 

Continue reading

More on CouchDB installation-part 1

Warning

CouchDB 1.0.x crashes on Windows when a database or index file reaches 4Gb in Erlang/OTP versions previous to R14B01. This is due to a Erlang/OTP Windows bug related with appending to files with a size equal to 4Gb or larger. Erlang/OTP release R14B01 no longer has this bug.

This page describes how to build and install couchdb from source on Windows. See also the Windows_binary_installer.

Windows Installer

There is a Windows binary installer in “beta testing”. See the wiki page for it for more instructions.

Other source of installers for Windows, including future CouchDB releases, are at

Building current couchdb versions

As of couchdb 0.10, support for Windows is included in the standard build process. View README in the root of the source tree for information about the dependencies and how to configure the build process. In summary, you will need to:

  • Install the cygwin environment.
  • Install the MS C compiler.
  • Install and possibly build a number of pre-requisites, such as curl, icu, spidermonkey, etc.
  • get the sources to erlang and couch
  • configure and build erlang according to the instructions.
  • configure and build couch according to the README file in couch

After executing ‘make install’, you will find a couchdb directory structure inside your erlang directory – that is, the couch build process simply installs its libraries into the erlang binaries you previously build. This directory structure should be ready to roll – it can be zipped up, packaged by an installer, etc.

 

Continue reading

Futon-CouchDB Administrative Tool

Getting Started

In this chapter, we’ll take a quick tour of CouchDB’s features, familiarizing ourselves with Futon, the built-in administration interface. We’ll create our first document and experiment with CouchDB views. Before we start, skip to Appendix D, Installing from Source and look for your operating system. You will need to follow those instructions and get CouchDB installed before you can progress.

All Systems Are Go!

We’ll have a very quick look at CouchDB’s bare-bones Application Programming Interface (API) by using the command-line utility curl. Please note that this is not the only way of talking to CouchDB. We will show you plenty more throughout the rest of the book. What’s interesting about curl is that it gives you control over raw HTTP requests, and you can see exactly what is going on “underneath the hood” of your database.

 

Continue reading

Exploring more on CouchDB

What is CouchDB?

CouchDB is an open source document-oriented database-management system, accessible using a RESTful JavaScript Object Notation (JSON) API. The term “Couch” is an acronym for “Cluster Of Unreliable Commodity Hardware,” reflecting the goal of CouchDB being extremely scalable, offering high availability and reliability, even while running on hardware that is typically prone to failure. CouchDB was originally written in C++, but in April 2008, the project moved to the Erlang OTP platform for its emphasis on fault tolerance.

CouchDB can be installed on most POSIX systems, including Linux® and Mac OS X. Although Windows® isn’t currently officially supported, work is under way on an unofficial binary installer for the Windows platform. CouchDB can be installed from source or, where available, it can be installed using a package manager (e.g., MacPorts on Mac OS X).

CouchDB is a top-level Apache Software Foundation open source project, released under V2.0 of the Apache license. This open source license allows the source code to be used and modified for use in other software, so long as the copyright notice and disclaimer are preserved. Like most open source licenses, it allows the software to be used, modified, and distributed by users as required. Any modifications do not have to be made available under the same license, so long as a notice of use of Apache-licensed code is maintained.

 

Continue reading

Installing CouchApp

Installing

The newest install instructions are always in the README

Requirements

  • Python 2.x >= 2.5 (Python 3.x will be supported soon)

Installing on all UNIXs

To install couchapp using easy_install you must make sure you have a recent version of distribute installed:

$ curl -O http://python-distribute.org/distribute_setup.py 
$ sudo python distribute_setup.py $ easy_install pip 

To install or upgrade to the latest released version of couchapp:

$ sudo pip install couchapp 

To install/upgrade development version :

$ sudo pip install git+http://github.com/couchapp/couchapp.git#egg=Couchapp 

Installing in a sandboxed environnement.

If you want to work in a sandboxed environnement which is recommended if you don’t want to not “pollute” your system, you can usevirtualenv :

$ curl -O http://python-distribute.org/distribute_setup.py 
$ sudo python distribute_setup.py 
$ easy_install pip $ pip install virtualenv 

Then to install couchapp :

$ pip -E couchapp_env install couchapp 

This command create a sandboxed environment in couchapp_env folder. To activate and work in this environment:

$ cd couchapp_env && . ./bin/activate 

Then you can work on your couchapps. I usually have a couchapps folder in couchapp_env where I put my couchapps.

Installing from source :

Follow instructions here

Installing on macosx

Using Couchapp Standalone executable :

Download Couchapp-0.8.1-macosx.zip on Github then double-click on the installer.

Using th python metapackage for macosx 10.5 or macosx 10.6

Using Homebrew

To install easily couchapp on MacOSX, it may be easier to use homebrew to install pip.

Once you installed homebrew, do :

$ brew install pip && pip install couchapp 

That’s it.

Installing on ubuntu

If you use [Ubuntu](http://www.ubuntu.com/-, you can update your system with packages from our PPA by addingppa:couchapp/couchapp to your system’s Software Sources.

Follow instructions here.

Installing on Windows

There are currently 3 methods to install on windows: