Is Apache CouchDB for you? Sumedha Rubasinghe sumedha@apache.org
During this 45 mins.. What is Apache CouchDB? Paradigm for modeling data Demonstration Features
What CouchDB is NOT.. Relational Database SQL Tabular storage of data Replacement for relational databases
Different paradigm to model data Real world application – based on data in a document Relational model – maps data into tables, columns How about storing the document as it is !!!
What is CouchDB then? Document based database server Key-value type of storage Schema free documents stored in JSON format versioning REST API Views Open source
JSON ? Java Script Object Notation lightweight data storage format based on a subset of JavaScipt syntax eg: { "Subject": "ASF turns 10", "Author": "ajith", "PostedDate": "2009-11-20", "Tags": [ "Apache Software Foundation", "Open source" ], "Body": "Recently Apache Software Foundation became 10 years old." }
Getting started - Installation Documentation http://wiki.apache.org/couchdb/Installatio n Unix-like systems Mac OS X Windows http://people.virginia.edu/~lmb7s/couch Latest source distribution (4th Dec 2009) 0.10.1
Accessing DB engine - REST REST API curl (unix like OS) cURL (windows) GET/PUT/POST/DELETE
Accessing DB engine - Futon Futon – Web administration console
Creating a database Using REST API Using Futon
Creating a document Futon REST API
Views What is a view? View in CouchDB context A "show" that directly renders a document using JavaScript MapReduce Two types Permanent view Indexed JSON for the view is stored as a design document Temporary view Sent via a HTTP POST Computed on the fly Creating a view using Futon
Programming with CouchDB Clients available for many languages C, C#, Erlang, Java, JavaScript, Perl, PHP, Python,Ruby & many more.. http://wiki.apache.org/couchdb/Basics
Sample Java Client (CouchDB4J) connection
Sample Java Client (CouchDB4J) Accessing views
CouchApp Develop CouchDB applications in a convenient directory structure Separate folder for css,js,images,etc... To deploy – couchapp push Change & deploy – couchapp push
Interesting features Replication Versioning Validation functions/macros
Important configuration files Linux environment Start up script /usr/local/etc/init.d/couchdb start | status | stop Configurations (ports,users) /usr/local/etc/couchdb/local.ini
Samples on the web http://jchrisa.net/cal/_design/cal/index .html http://github.com/quirkey/swinger
References http://wiki.apache.org/couchdb/ http://couchdb.apache.org/
Thank you