PhpRiot
News Archive
PhpRiot Newsletter
Your Email Address:

More information

Zend Developer Zone: Getting started with CouchDB : meet PHP on Couch

Note: This article was originally published at PHPDeveloper on 11 September 2010.
PHPDeveloper

On the Zend Developer Zone today Michael Bailey has posted an introduction to CouchDb including some sample code (in a download) and a look at the basics of using the database itself.

I will not detail the installation of the CouchDB server, the wiki got enough details. For the rest of this article I will assume that we have a running CouchDB server waiting for our queries on couch.example.com on port 5984 (the default CouchDB port). Setting up PHP on Couch is not really complicated : just download it on github.com, extract the archive : the interesting bits are in the lib folder.

He starts with some of the key terms you'll need on the CouchDb side (like JSON, documents, _id and _rev) followed by the interaction between PHP and the database - creating a database, storing a document, using the document object mapper and working with views.