CouchApps with
CouchDB & jQuery
  Cross-Platform, Offline-Enabled,
       Synchronizable Apps
The Problem Set
Problem:
Multiple Platforms
How to create apps for multiple platforms?
Problem:
Multiple Platforms
How to create apps for multiple platforms?
Problem:
Multiple Platforms
How to create apps for multiple platforms?




   Native app for
  each supported
     platform
Problem:
Multiple Platforms
How to create apps for multiple platforms?




   Native app for
  each supported
     platform
                            Web app
                          optimized for
                       targeted platforms
Problem:
Multiple Platforms
How to create apps for multiple platforms?




   Native app for                                Web app
  each supported                             packaged up as a
     platform
                            Web app           “native” app for
                          optimized for        each platform
                       targeted platforms
Problem:
Multiple Platforms
How to create apps for multiple platforms?




   Native app for                                Web app
  each supported                             packaged up as a
     platform
                            Web app           “native” app for
                          optimized for        each platform
                       targeted platforms
Problem:
Offline Apps
How to create offline apps?
Problem:
Offline Apps
How to create offline apps?
Problem:
Offline Apps
How to create offline apps?



    HTML5:
 Offline Web[1]
Applications




                            1. http://diveintohtml5.org/offline.html
                            2. http://diveintohtml5.org/storage.html
Problem:
Offline Apps
How to create offline apps?



    HTML5:
 Offline Web[1]         HTML5:
Applications          Local
                    Storage[2]




                                 1. http://diveintohtml5.org/offline.html
                                 2. http://diveintohtml5.org/storage.html
Problem:
Offline Apps
How to create offline apps?

                                  HTML5:
                                 IndexedDB
    HTML5:
 Offline Web[1]         HTML5:
Applications          Local
                    Storage[2]




                                      1. http://diveintohtml5.org/offline.html
                                      2. http://diveintohtml5.org/storage.html
Problem:
Offline Apps
How to create offline apps?

                                  HTML5:
                                 IndexedDB
    HTML5:
 Offline Web[1]         HTML5:
Applications          Local
                    Storage[2]
                                                      HTML5
                                                                :
                                                Web SQ
                                                Databa L
                                                      se




                                      1. http://diveintohtml5.org/offline.html
                                      2. http://diveintohtml5.org/storage.html
Problem:
Offline Apps
How to create offline apps?

                                  HTML5:
                                 IndexedDB
    HTML5:
 Offline Web[1]         HTML5:
Applications          Local
                    Storage[2]
                                                      HTML5
                                                                :
                                                Web SQ
                                                Databa L
                                                      se
        Embedded
        Database:
         SQLite

                                      1. http://diveintohtml5.org/offline.html
                                      2. http://diveintohtml5.org/storage.html
Problem:
Offline Apps
How to create offline apps?

                                              HTML5:
                                             IndexedDB
    HTML5:
 Offline Web[1]         HTML5:
Applications          Local
                    Storage[2]
                                                                  HTML5
                                                                            :
                                                            Web SQ
                                                            Databa L
                                                                  se
        Embedded                 Embedded
        Database:                Database:
         SQLite                CouchDB/
                               Couchbase
                                                  1. http://diveintohtml5.org/offline.html
                                                  2. http://diveintohtml5.org/storage.html
Problem:
Offline Apps
How to create offline apps?

                                              HTML5:
                                             IndexedDB
    HTML5:
 Offline Web[1]         HTML5:
Applications          Local
                    Storage[2]
                                                                  HTML5
                                                                            :
                                                            Web SQ
                                                            Databa L
                                                                  se
        Embedded                 Embedded
        Database:                Database:
         SQLite                CouchDB/
                               Couchbase
                                                  1. http://diveintohtml5.org/offline.html
                                                  2. http://diveintohtml5.org/storage.html
Problem:
Synchronization
How to synchronize data between devices, servers and users?
Problem:
Synchronization
How to synchronize data between devices, servers and users?
Problem:
Synchronization
How to synchronize data between devices, servers and users?




   Build your own
    sync feature
Problem:
Synchronization
How to synchronize data between devices, servers and users?




   Build your own
    sync feature                  iCloud
Problem:
Synchronization
How to synchronize data between devices, servers and users?




   Build your own
    sync feature                  iCloud




         Domain-speci c
         synchronization
           (e.g. SyncML)
Problem:
Synchronization
How to synchronize data between devices, servers and users?




   Build your own
    sync feature                  iCloud




         Domain-speci c                CouchDB/
         synchronization
           (e.g. SyncML)
                                   Couchbase Mobile
                                    synchronization
Problem:
Synchronization
How to synchronize data between devices, servers and users?




   Build your own
    sync feature                  iCloud




         Domain-speci c                CouchDB/
         synchronization
           (e.g. SyncML)
                                   Couchbase Mobile
                                    synchronization
One Possible Solution
CouchApp
CouchApp
• web app built using JavaScript, CSS and HTML5
CouchApp
• web app built using JavaScript, CSS and HTML5
• can be packaged up as a “native” app
CouchApp
• web app built using JavaScript, CSS and HTML5
• can be packaged up as a “native” app
• stores data in its own CouchDB/Couchbase database
CouchApp
•   web app built using JavaScript, CSS and HTML5
•   can be packaged up as a “native” app
•   stores data in its own CouchDB/Couchbase database
•   can synchronize with other CouchApps




             +                           =
Creating “Native” Mobile Web Apps
jQuery Mobile: Touch-
Optimized Web Framework
“A uni ed user interface
system across all popular
mobile device platforms,
built on the rock-solid jQuery
and jQuery UI foundation. Its
lightweight code is built with
progressive enhancement,
and has a exible, easily
themeable design.”

From:
http://jquerymobile.com/
PhoneGap
“PhoneGap is an HTML5 app
platform that allows you to
author native applications
with web technologies and get
access to APIs and app stores.
PhoneGap leverages web
technologies developers
already know best... HTML and
JavaScript.”

From:
http://www.phonegap.com/
Building iPhone Apps with
HTML, CSS, and JavaScript
“It's a fact: if you know HTML, CSS,
and JavaScript, you already have
the tools you need to develop
your own iPhone apps. With this
book, you'll learn how to use these
open source web technologies to
design and build apps for the
iPhone and iPod Touch on the
platform of your choice-without
using Objective-C or Cocoa.”

From:
http://shop.oreilly.com/
product/9780596805791.do
Building Android Apps with
HTML, CSS, and JavaScript
“If you know HTML, CSS, and
JavaScript, you already have
the tools you need to develop
Android applications. This
hands-on book shows you how
to use these open source web
standards to design and build
apps that can be adapted for
any Android device – without
having to use Java.”

From:
http://shop.oreilly.com/
product/0636920010067.do
CouchDB and Couchbase
About CouchDB
About CouchDB
• a database that stores JSON "documents"
About CouchDB
• a database that stores JSON "documents"
• accessed through HTTP
About CouchDB
• a database that stores JSON "documents"
• accessed through HTTP
• queried using views produced by Map/Reduce functions
About CouchDB
•   a database that stores JSON "documents"
•   accessed through HTTP
•   queried using views produced by Map/Reduce functions
•   can also serve static les
About CouchDB
•   a database that stores JSON "documents"
•   accessed through HTTP
•   queried using views produced by Map/Reduce functions
•   can also serve static les
•   can act as a "side-effect free" web application server
About Couchbase
About Couchbase
• superset of CouchDB
About Couchbase
• superset of CouchDB
• includes geospatial indexing
About Couchbase
• superset of CouchDB
• includes geospatial indexing
• available as Couchbase Mobile for iOS and Android
Device
Synchronization
CouchApp Examples
Grocery Sync
Demo app that keeps
your shopping list in
sync between devices.

Links:
  • CouchApp code
  • iOS code
  • Android code
  • Presentation about
    Couchbase Mobile
Monocles
Diaspora federated social
web node implemented
as a CouchApp.

Links:
  • Demo
  • Code
  • ReadWriteHack
    Interview with
    Max Ogden:
    Part 1, Part 2
CatMapper
“Geospatially referencing cats”

Links:
  • Demo
  • Code
The CouchDB jQuery Plugin
HTML Skeleton
<!DOCTYPE html>
<html>
 <head>
  <title>jQuery and CouchDB</title>
  <script src="/_utils/script/jquery.js?1.4.2"></script>
  <script src="/_utils/script/jquery.couch.js?0.11.0"></script>
 </head>
 <body>
 </body>
</html>
The same-origin policy[1] dictates that
your HTML and AJAX data (JSON) must
be retrieved from the same origin.




                        1. http://www.w3.org/Security/wiki/Same_Origin_Policy
All Databases
All Databases
$.couch.allDbs({
   success: function(data) {
     console.log(data);
   }
});
All Databases
$.couch.allDbs({
   success: function(data) {
     console.log(data);
   }
});

GET http://localhost:5984/_all_dbs 200 OK
All Databases
$.couch.allDbs({
   success: function(data) {
     console.log(data);
   }
});

GET http://localhost:5984/_all_dbs 200 OK

[
    "_replicator",
    "_users"
]
Create a Database
Create a Database
$.couch.db("mydb").create({
   success: function(data) {
     console.log(data);
   }
});
Create a Database
$.couch.db("mydb").create({
   success: function(data) {
     console.log(data);
   }
});

PUT http://localhost:5984/mydb 201 Created
Create a Database
$.couch.db("mydb").create({
   success: function(data) {
     console.log(data);
   }
});

PUT http://localhost:5984/mydb 201 Created

{"ok":true}
Save a New Document
Save a New Document
$.couch.db("mydb").saveDoc({}, {
   success: function(data) {
     console.log(data);
   }
});
Save a New Document
$.couch.db("mydb").saveDoc({}, {
   success: function(data) {
     console.log(data);
   }
});

POST http://localhost:5984/mydb    201 Created
Save a New Document
$.couch.db("mydb").saveDoc({}, {
   success: function(data) {
     console.log(data);
   }
});

POST http://localhost:5984/mydb    201 Created

{
    "ok":true,
    "id":"e15d848571c8a0352e94738ba6018790",
    "rev":"1-967a00dff5e02add41819138abb3284d"
}
Open a Document
Open a Document
$.couch.db("mydb").openDoc("e15d8485…", {
   success: function(data) {
     console.log(data);
   }
});
Open a Document
$.couch.db("mydb").openDoc("e15d8485…", {
   success: function(data) {
     console.log(data);
   }
});

GET http://localhost:5984/mydb/e15d8485…    200 OK
Open a Document
$.couch.db("mydb").openDoc("e15d8485…", {
   success: function(data) {
     console.log(data);
   }
});

GET http://localhost:5984/mydb/e15d8485…    200 OK

{
    _id="e15d848571c8a0352e94738ba6018790",
    _rev="1-967a00dff5e02add41819138abb3284d"
}
Save an Updated Document
Save an Updated Document
var doc = {
   _id: "0a72c9c36bd169818dc97ed18b000aa4",
   _rev: "1-967a00dff5e02add41819138abb3284d",
   title: "CouchApps"
};

$.couch.db("mydb").saveDoc(doc, {
   success: function(data) {
     console.log(data);
   }
});
Save an Updated Document
var doc = {
   _id: "0a72c9c36bd169818dc97ed18b000aa4",
   _rev: "1-967a00dff5e02add41819138abb3284d",
   title: "CouchApps"
};

$.couch.db("mydb").saveDoc(doc, {
   success: function(data) {
     console.log(data);
   }
});

PUT http://localhost:5984/mydb/0a72c9c3…        201 Created
Save an Updated Document
var doc = {
   _id: "0a72c9c36bd169818dc97ed18b000aa4",
   _rev: "1-967a00dff5e02add41819138abb3284d",
   title: "CouchApps"
};

$.couch.db("mydb").saveDoc(doc, {
   success: function(data) {
     console.log(data);
   }
});

PUT http://localhost:5984/mydb/0a72c9c3…         201 Created

{
    "ok":true,
    "id":"0a72c9c36bd169818dc97ed18b000aa4",
    "rev":"2-516027e3179a22a22e06874c374e8ef0"
}
Remove Document
Remove Document
var doc = {
   _id: "0a72c9c36bd169818dc97ed18b000aa4",
   _rev: "2-516027e3179a22a22e06874c374e8ef0"
};

$.couch.db("mydb").removeDoc(doc, {
    success: function(data) {
      console.log(data);
   }
});
Remove Document
var doc = {
   _id: "0a72c9c36bd169818dc97ed18b000aa4",
   _rev: "2-516027e3179a22a22e06874c374e8ef0"
};

$.couch.db("mydb").removeDoc(doc, {
    success: function(data) {
      console.log(data);
   }
});

DELETE http://localhost:5984/mydb/0a72…?rev=2-51… 200 OK
Remove Document
var doc = {
   _id: "0a72c9c36bd169818dc97ed18b000aa4",
   _rev: "2-516027e3179a22a22e06874c374e8ef0"
};

$.couch.db("mydb").removeDoc(doc, {
    success: function(data) {
      console.log(data);
   }
});

DELETE http://localhost:5984/mydb/0a72…?rev=2-51… 200 OK

{
    "id": "0a72c9c36bd169818dc97ed18b000aa4"
    "ok":true,
    "rev":"3-e9a5aa1c486eee23c84fa028bc904991"
}
Changes
Changes
$.couch.db("mydb").changes().onChange(function(data) {
   console.log(data);
});
Changes
$.couch.db("mydb").changes().onChange(function(data) {
   console.log(data);
});

GET http://localhost:5984/mydb/_changes
?heartbeat=10000&feed=longpoll&since=34     200 OK
Changes
$.couch.db("mydb").changes().onChange(function(data) {
   console.log(data);
});

GET http://localhost:5984/mydb/_changes
?heartbeat=10000&feed=longpoll&since=34     200 OK

{ "results":[
     { "seq":35,
       "id":"d12ee5ea1df6baa2b06451f44a01b7b5",
       "changes":[
         { "rev":"1-967a00dff5e02add41819138abb3284d" }
       ]
     }
  ],
  "last_seq":35
}
Documentation
CouchDB jQuery Plugin Reference
http://bradley-holt.com/2011/07/couchdb-jquery-plugin-reference/

jQuery CouchDB jsDoc Reference
http://daleharvey.github.com/jquery.couch.js-docs/symbols/index.html
CouchApp Tooling
Compiling and Pushing
a CouchApp
Install the CouchApp Tool
Install the CouchApp Tool
$ sudo easy_install pip
Install the CouchApp Tool
$ sudo easy_install pip

$ sudo pip install couchapp
Generate a CouchApp
Generate a CouchApp
$ couchapp generate tutorial
Generate a CouchApp
$ couchapp generate tutorial

2011-09-27 11:54:12 [INFO] /tutorial generated.
Generate a CouchApp
$ couchapp generate tutorial

2011-09-27 11:54:12 [INFO] /tutorial generated.

$ cd tutorial
Generated Files
Generated Files
$ tree -FL 1
Generated Files
$ tree -FL 1

.
      README.md
      _attachments/
      _id
      couchapp.json
      evently/
      language
      lists/
      shows/
      updates/
      vendor/
Push the CouchApp
Push the CouchApp
$ couchapp push tutorial
Push the CouchApp
$ couchapp push tutorial

2011-09-27 11:55:02 [INFO] Visit your CouchApp here:
http://127.0.0.1:5984/tutorial/_design/tutorial/index.html
The Generated CouchApp
A CouchApp is entirely self-contained
within a design document.
About Design Documents
A CouchDB design document stores
application-speci c code such as:
  • View de nitions
    • Map functions
    • Reduce functions
  • Show functions
  • List functions
  • Document update handlers
  • Document update validation functions
  • Rewrite de nitions
  • Arbitrary elds
  • Attachments
CouchApp Building Blocks
Evently
Evently is a jQuery plugin for
writing event-based applications.
Widgets
$("#user").evently({
   _init: {
     async: function(callback) {
        $.couch.session({
           success: function(data) {
             callback(data);
           }
        });
     },
     mustache: "<span>{{#name}}Logged in as {{name}}{{/name}}
{{^name}}Not logged in{{/name}}</span>",
     data: function(data) {
        return data.userCtx;
     }
   }
});
CouchApp + Evently
CouchApp + Evently
$ tree -F evently
CouchApp + Evently
$ tree -F evently

evently
       items/
           _changes/
                data.js
                mustache.html
                query.json
       profile/
         profileReady/
            mustache.html
            selectors/
                 form/
}
Mustache
Logic-Less Templates
Evently knows how to wire Mustache
templates and data together.
Variables
Template:
<p>Hello, {{name}}.</p>

Hash:
{
  "name": "Bradley"
}

Output:
<p>Hello, Bradley.</p>
False or Empty Sections
Template:
<p>Shown.</p>
{{#show}}
<p>Not shown.</p>
{{/show}}

Hash:
{
  "show": false
}

Output:
<p>Shown.</p>
Inverted Sections
Template:
{{^user}}
 <p>Not logged in</p>
{{/user}}

Hash:
{
  "user": false
}

Output:
 <p>Not logged in</p>
Non-Empty Lists
Template:
{{#users}}
 <p>{{name}}</p>
{{/users}}

Hash:
{ "users": [
    { "name": "Bradley" },
    { "name": "Jason" },
  ]
}

Output:
 <p>Bradley</p>
 <p>Jason</p>
CouchApp + Evently +
Mustache
CouchApp + Evently +
Mustache
$ tree -F evently/posts
CouchApp + Evently +
Mustache
$ tree -F evently/posts

evently/posts
       _init.js
       data.js
       mustache.html
       post/
           _init.js
           data.js
           mustache.html
           query.json
       query.json
The “Posts” Mustache File
The “Posts” Mustache File
$ cat evently/posts/mustache.html
The “Posts” Mustache File
$ cat evently/posts/mustache.html

<ul>
{{#posts}}
 <li>
  <a href="/posts/{{id}}">{{title}}</a>
 </li>
{{/posts}}
</ul>
The “Post” Mustache File
The “Post” Mustache File
$ cat evently/posts/post/mustache.html
The “Post” Mustache File
$ cat evently/posts/post/mustache.html

{{#post}}
<article>
 <h1>{{title}}</h1>
 {{content}}
 <p><a href="/posts/{{id}}">{{updated}}</a></p>
</article>
{{/post}}
Pathbinder
Pathbinder is a jQuery plugin for
triggering events based on the path
components of a URL hash.
Pathbinder + Evently
<div id="pro le"></div>
<script type="text/javascript">
$("#pro le").evently({
   _init: {
      path: "/",
      mustache: '<p><a href="#/pro le/Bradley">View Pro le</a></p>'
   },
   viewPro le: {
      path: "/pro le/:id",
      mustache: '<p>Viewing {{id}}'s pro le; <a href="#/">Back</a></p>',
      data: function(e, params) {
        return params;
      }
   }
});
</script>
An Evently widget’s path de nition
can be stored in a path.txt le within
a CouchApp.
CouchApp + Evently +
Pathbinder
CouchApp + Evently +
Pathbinder
$ tree -F evently/posts
CouchApp + Evently +
Pathbinder
$ tree -F evently/posts

evently/posts
       _init.js
       data.js
       mustache.html
       path.txt
       post/
           _init.js
           data.js
           mustache.html
           path.txt
Path Files
Path Files
$ cat evently/posts/path.txt
Path Files
$ cat evently/posts/path.txt

/posts
Path Files
$ cat evently/posts/path.txt

/posts

$ cat evently/posts/post/path.txt
Path Files
$ cat evently/posts/path.txt

/posts

$ cat evently/posts/post/path.txt

/posts/:id
Resources
Alternative CouchApp Tools
node.couchapp.js
  • Command-line tool written for Node.js
  • https://github.com/mikeal/node.couchapp.js
Kanso Framework
  • Also built using Node.js
  • http://kansojs.org
soca
  •    Command-line tool written in Ruby
  •    https://github.com/quirkey/soca

Reupholster
  • A simple way to get started developing CouchApps
  • http://reupholster.iriscouch.com/reupholster/_design/app/index.html
Hosting
Iris Couch
   • Free (for now)
   • Couchbase server
   • GeoCouch geospatial indexing
   • http://www.iriscouch.com
Cloudant
  • Various pricing levels
  • Full-text searching
  • Ad-hoc queries
  • Elastic scaling, clustering and sharding using BigCouch
  • https://cloudant.com
Documentation and Books
CouchApp Wiki                     Writing and Querying MapReduce
http://couchapp.org/              Views in CouchDB
                                  by Bradley Holt (O’Reilly)
CouchDB Wiki                      978-1-449-30312-9
http://wiki.apache.org/couchdb/
                                  Scaling CouchDB
CouchDB: The De nitive Guide      by Bradley Holt (O’Reilly)
by J. Chris Anderson, Jan         063-6-920-01840-7
Lehnardt and Noah Slater
(O’Reilly)                        Beginning CouchDB
978-0-596-15589-6                 by Joe Lennon (Apress)
                                  978-1-430-27237-3
http://oreilly.com/catalog/9781449303129/   http://oreilly.com/catalog/9781449303433/
Questions?
Thank You
                                  @BradleyHolt
                             http://bradley-holt.com
                           bradley.holt@foundline.com




Copyright © 2011 Bradley Holt. All rights reserved.

jQuery Conference Boston 2011 CouchApps

Editor's Notes

  • #2 \n
  • #3 \n
  • #4 \n
  • #5 &amp;#x201C;Add to home screen&amp;#x201D; option\n
  • #6 &amp;#x201C;Add to home screen&amp;#x201D; option\n
  • #7 &amp;#x201C;Add to home screen&amp;#x201D; option\n
  • #8 &amp;#x201C;Add to home screen&amp;#x201D; option\n
  • #9 &amp;#x201C;Add to home screen&amp;#x201D; option\n
  • #10 \n
  • #11 &amp;#x201C;Offline Web Applications&amp;#x201D; refers to &amp;#x201C;appcache&amp;#x201D; or &amp;#x201C;application cache&amp;#x201D; which is implemented via a cache manifest file.\n&amp;#x201C;Local Storage&amp;#x201D; refers to the &amp;#x201C;Web Storage API&amp;#x201D; which stores key/value pairs.\n
  • #12 &amp;#x201C;Offline Web Applications&amp;#x201D; refers to &amp;#x201C;appcache&amp;#x201D; or &amp;#x201C;application cache&amp;#x201D; which is implemented via a cache manifest file.\n&amp;#x201C;Local Storage&amp;#x201D; refers to the &amp;#x201C;Web Storage API&amp;#x201D; which stores key/value pairs.\n
  • #13 &amp;#x201C;Offline Web Applications&amp;#x201D; refers to &amp;#x201C;appcache&amp;#x201D; or &amp;#x201C;application cache&amp;#x201D; which is implemented via a cache manifest file.\n&amp;#x201C;Local Storage&amp;#x201D; refers to the &amp;#x201C;Web Storage API&amp;#x201D; which stores key/value pairs.\n
  • #14 &amp;#x201C;Offline Web Applications&amp;#x201D; refers to &amp;#x201C;appcache&amp;#x201D; or &amp;#x201C;application cache&amp;#x201D; which is implemented via a cache manifest file.\n&amp;#x201C;Local Storage&amp;#x201D; refers to the &amp;#x201C;Web Storage API&amp;#x201D; which stores key/value pairs.\n
  • #15 &amp;#x201C;Offline Web Applications&amp;#x201D; refers to &amp;#x201C;appcache&amp;#x201D; or &amp;#x201C;application cache&amp;#x201D; which is implemented via a cache manifest file.\n&amp;#x201C;Local Storage&amp;#x201D; refers to the &amp;#x201C;Web Storage API&amp;#x201D; which stores key/value pairs.\n
  • #16 &amp;#x201C;Offline Web Applications&amp;#x201D; refers to &amp;#x201C;appcache&amp;#x201D; or &amp;#x201C;application cache&amp;#x201D; which is implemented via a cache manifest file.\n&amp;#x201C;Local Storage&amp;#x201D; refers to the &amp;#x201C;Web Storage API&amp;#x201D; which stores key/value pairs.\n
  • #17 &amp;#x201C;Offline Web Applications&amp;#x201D; refers to &amp;#x201C;appcache&amp;#x201D; or &amp;#x201C;application cache&amp;#x201D; which is implemented via a cache manifest file.\n&amp;#x201C;Local Storage&amp;#x201D; refers to the &amp;#x201C;Web Storage API&amp;#x201D; which stores key/value pairs.\n
  • #18 &amp;#x201C;Offline Web Applications&amp;#x201D; refers to &amp;#x201C;appcache&amp;#x201D; or &amp;#x201C;application cache&amp;#x201D; which is implemented via a cache manifest file.\n&amp;#x201C;Local Storage&amp;#x201D; refers to the &amp;#x201C;Web Storage API&amp;#x201D; which stores key/value pairs.\n
  • #19 &amp;#x201C;Offline Web Applications&amp;#x201D; refers to &amp;#x201C;appcache&amp;#x201D; or &amp;#x201C;application cache&amp;#x201D; which is implemented via a cache manifest file.\n&amp;#x201C;Local Storage&amp;#x201D; refers to the &amp;#x201C;Web Storage API&amp;#x201D; which stores key/value pairs.\n
  • #20 &amp;#x201C;Offline Web Applications&amp;#x201D; refers to &amp;#x201C;appcache&amp;#x201D; or &amp;#x201C;application cache&amp;#x201D; which is implemented via a cache manifest file.\n&amp;#x201C;Local Storage&amp;#x201D; refers to the &amp;#x201C;Web Storage API&amp;#x201D; which stores key/value pairs.\n
  • #21 &amp;#x201C;Offline Web Applications&amp;#x201D; refers to &amp;#x201C;appcache&amp;#x201D; or &amp;#x201C;application cache&amp;#x201D; which is implemented via a cache manifest file.\n&amp;#x201C;Local Storage&amp;#x201D; refers to the &amp;#x201C;Web Storage API&amp;#x201D; which stores key/value pairs.\n
  • #22 &amp;#x201C;Offline Web Applications&amp;#x201D; refers to &amp;#x201C;appcache&amp;#x201D; or &amp;#x201C;application cache&amp;#x201D; which is implemented via a cache manifest file.\n&amp;#x201C;Local Storage&amp;#x201D; refers to the &amp;#x201C;Web Storage API&amp;#x201D; which stores key/value pairs.\n
  • #23 \n
  • #24 Building your own sync feature is difficult.\niCloud is for iOS 5 only.\nCouchbase Mobile works on both iOS and Android devices.\n
  • #25 Building your own sync feature is difficult.\niCloud is for iOS 5 only.\nCouchbase Mobile works on both iOS and Android devices.\n
  • #26 Building your own sync feature is difficult.\niCloud is for iOS 5 only.\nCouchbase Mobile works on both iOS and Android devices.\n
  • #27 Building your own sync feature is difficult.\niCloud is for iOS 5 only.\nCouchbase Mobile works on both iOS and Android devices.\n
  • #28 Building your own sync feature is difficult.\niCloud is for iOS 5 only.\nCouchbase Mobile works on both iOS and Android devices.\n
  • #29 Building your own sync feature is difficult.\niCloud is for iOS 5 only.\nCouchbase Mobile works on both iOS and Android devices.\n
  • #30 Building your own sync feature is difficult.\niCloud is for iOS 5 only.\nCouchbase Mobile works on both iOS and Android devices.\n
  • #31 \n
  • #32 Technically, a CouchApp can synchronize with anything else using CouchDB/Couchbase.\n
  • #33 Technically, a CouchApp can synchronize with anything else using CouchDB/Couchbase.\n
  • #34 Technically, a CouchApp can synchronize with anything else using CouchDB/Couchbase.\n
  • #35 Technically, a CouchApp can synchronize with anything else using CouchDB/Couchbase.\n
  • #36 Technically, a CouchApp can synchronize with anything else using CouchDB/Couchbase.\n
  • #37 Not the focus of this talk.\n
  • #38 \n
  • #39 \n
  • #40 \n
  • #41 \n
  • #42 \n
  • #43 Static files could include HTML files, images, videos, etc.\nDiscuss &amp;#x201C;side-effect free&amp;#x201D; in the context of CouchDB show and list functions.\n
  • #44 Static files could include HTML files, images, videos, etc.\nDiscuss &amp;#x201C;side-effect free&amp;#x201D; in the context of CouchDB show and list functions.\n
  • #45 Static files could include HTML files, images, videos, etc.\nDiscuss &amp;#x201C;side-effect free&amp;#x201D; in the context of CouchDB show and list functions.\n
  • #46 Static files could include HTML files, images, videos, etc.\nDiscuss &amp;#x201C;side-effect free&amp;#x201D; in the context of CouchDB show and list functions.\n
  • #47 Static files could include HTML files, images, videos, etc.\nDiscuss &amp;#x201C;side-effect free&amp;#x201D; in the context of CouchDB show and list functions.\n
  • #48 Static files could include HTML files, images, videos, etc.\nDiscuss &amp;#x201C;side-effect free&amp;#x201D; in the context of CouchDB show and list functions.\n
  • #49 Geospatial indexing is implemented via GeoCouch.\nCouchbase is also the name of the company behind the product of the same name.\nCouchbase contributes back to CouchDB.\n
  • #50 Geospatial indexing is implemented via GeoCouch.\nCouchbase is also the name of the company behind the product of the same name.\nCouchbase contributes back to CouchDB.\n
  • #51 Geospatial indexing is implemented via GeoCouch.\nCouchbase is also the name of the company behind the product of the same name.\nCouchbase contributes back to CouchDB.\n
  • #52 Geospatial indexing is implemented via GeoCouch.\nCouchbase is also the name of the company behind the product of the same name.\nCouchbase contributes back to CouchDB.\n
  • #53 CouchDB implements multi-master replication.\nCouchApps are an example of &amp;#x201C;ground computing&amp;#x201D; where data moves from the &amp;#x201C;cloud&amp;#x201D; to the end user&amp;#x2019;s device.\n
  • #54 \n
  • #55 I believe the iOS and Android versions are actually native.\n
  • #56 CouchDB is a great fit for decentralized social apps.\n
  • #57 This app takes advantage of the geospatial indexing available in GeoCouch.\n
  • #58 \n
  • #59 This will need to be served by CouchDB.\njQuery and the CouchDB jQuery plugin ship with CouchDB.\n
  • #60 \n
  • #61 Console logging can easily be replaced with DOM manipulation code.\n
  • #62 Console logging can easily be replaced with DOM manipulation code.\n
  • #63 Console logging can easily be replaced with DOM manipulation code.\n
  • #64 \n
  • #65 \n
  • #66 \n
  • #67 This is saving an empty document.\n
  • #68 This is saving an empty document.\n
  • #69 This is saving an empty document.\n
  • #70 \n
  • #71 \n
  • #72 \n
  • #73 \n
  • #74 \n
  • #75 \n
  • #76 A new revision is created when a document is deleted.\n
  • #77 A new revision is created when a document is deleted.\n
  • #78 A new revision is created when a document is deleted.\n
  • #79 This uses long polling, keeping a connection open between client and server.\n
  • #80 This uses long polling, keeping a connection open between client and server.\n
  • #81 This uses long polling, keeping a connection open between client and server.\n
  • #82 \n
  • #83 \n
  • #84 \n
  • #85 \n
  • #86 \n
  • #87 This CouchApp tool is written in Python.\nOther CouchApp tooling options are available.\n
  • #88 This CouchApp tool is written in Python.\nOther CouchApp tooling options are available.\n
  • #89 \n
  • #90 \n
  • #91 \n
  • #92 \n
  • #93 \n
  • #94 \n
  • #95 \n
  • #96 Includes account, profile and items widgets out-of-the-box.\n
  • #97 \n
  • #98 A database can have multiple CouchApps and/or design documents.\nDesign documents are named &amp;#x201C;_design/&lt;name&gt;&amp;#x201D;.\n
  • #99 \n
  • #100 \n
  • #101 \n
  • #102 Widgets are wired up to specified DOM elements.\n
  • #103 File system tree is packaged up as a set of Evently widgets.\nEvently widgets can be deeply nested.\n
  • #104 File system tree is packaged up as a set of Evently widgets.\nEvently widgets can be deeply nested.\n
  • #105 \n
  • #106 \n
  • #107 Variables can be &amp;#x201C;unescaped&amp;#x201D; by using three braces instead of two.\n&amp;#x201C;Missed&amp;#x201D; (e.g. undefined or null) variables will output nothing.\n
  • #108 \n
  • #109 \n
  • #110 \n
  • #111 \n
  • #112 \n
  • #113 Mustache templates seem to require one, and only one, root element.\n
  • #114 Mustache templates seem to require one, and only one, root element.\n
  • #115 \n
  • #116 \n
  • #117 \n
  • #118 \n
  • #119 Creating a &amp;#x201C;View Profile&amp;#x201D; hyperlink which can be clicked, triggering a &amp;#x201C;viewProfile&amp;#x201D; widget which contains a link &amp;#x201C;back&amp;#x201D; to the first widget.\n
  • #120 \n
  • #121 \n
  • #122 \n
  • #123 \n
  • #124 \n
  • #125 \n
  • #126 \n
  • #127 \n
  • #128 Not necessarily compatible with the Python version.\n
  • #129 \n
  • #130 \n
  • #131 \n
  • #132 \n
  • #133 \n