• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
CouchApp - Build scalable web applications and relax
 

CouchApp - Build scalable web applications and relax

on

  • 2,465 views

An introduction to CouchApp. Contains a brief intro to CouchDB than explains how to use CouchApp to maintain your design documents and how to create websites served by CouchDB.

An introduction to CouchApp. Contains a brief intro to CouchDB than explains how to use CouchApp to maintain your design documents and how to create websites served by CouchDB.

Statistics

Views

Total Views
2,465
Views on SlideShare
2,426
Embed Views
39

Actions

Likes
0
Downloads
0
Comments
0

2 Embeds 39

http://blog.openforce.com 38
http://www.slashdocs.com 1

Accessibility

Categories

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    CouchApp - Build scalable web applications and relax CouchApp - Build scalable web applications and relax Presentation Transcript

    • CouchApp Build scalable web applications and relax Wien, 7. April 2011 Gerhard Hipfinger
    • Before we begin First we need a brief intro to CouchDB
    • CouchDB is a schema free document store Access your documents via restful HTTP API JSON is used as document format What is CouchDB?
    • A simple example { "_id": "e3bcabbd12e92e4ea28198f5ad00756a", "_rev": "57-68386422f4554017aae948f0e5526425", "active": true, "email": "gerhard.hipfinger@openforce.com", "firstname": "Gerhard", "lastname": "Hipfinger", "dbName": "tempo_93aa6c3872ea46bb909365317c8dbfc3", "liveViewDayFolded": true, "liveViewWeekFolded": false, "liveViewMonthFolded": false, "creation": "2010-08-03T17:54:05.641+02:00", "docType": "TempoUser" }
    • How to access documents? Directly by URL and the document key Views (JavaScript Map/Reduce Scripts)
    • Map/Reduce sample function(doc) { if(doc.docType == 'TempoUser') { var date = doc.creation.substring(0,10); emit(date, 1); } } Map function Reduce function function(keys, values, rereduce) { return sum(values); }
    • What else can we do? Update functions for validation or authorization List functions for rendering lists Show functions for showing documents Binary attachments
    • So what? Finally you can save your app in CouchDB!
    • Now what's about CouchApp? CouchApp is a tool that helps you organize your CouchDB apps It's something like Ruby on Rails for CouchDB apps But it's not that easy and mature!
    • First steps with CouchApp Install CouchApp – it's a Python app Generate an application with couchapp generate You now have an ready to deploy CouchDB app
    • Maintain and Deploy You can use git, svn or whatever you want to manage your app couchapp push is used to deploy your app to a CouchDB node CouchApp finally helps you to maintain your design documents
    • CouchApp file mapping myapp/ views/ foobar/ map.js reduce.js { "_id" : "_design/myapp", "views" : { "foobar" : { "map" : "contents of map.js", "reduce" : "contents of reduce.js" } } }
    • CouchApp programming model CouchApp is much more than a code generator It also contains frontend libraries for fast UI development jQuery based Ajax „Evently“ and „Pathbinder“ JavaScript Frameworks for UI event handling
    • One solution for all apps? Relax in any case?
    • One solution for all apps? NO CouchApp is great to manage your design documents Don't manage your design documents (views, update functions) without CouchApp But be carefull when you try to create webapps only with CouchApp!
    • Good for... Small web apps that can be handled in a single page (like GWT) When your webapp does not require massive busines logic Bigger sites become hard to maintain Tool support only rudimentary
    • Questions?
    • Useful resources http://couchapp.org/ http://couchapp.org/page/evently-primer http://couchapp.org/page/evently-do-it-yourself http://couchdb.apache.org/ http://guide.couchdb.org/
    • Gerhard Hipfinger openForce Information Technology GesmbH Dresdner Str. 108 / 3. Stock / Top 11 1200 Wien TEL +43 1 3191775 FAX +43 1 3191775-20 http://openforce.com