couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Bisbee <>
Subject Re: to CouchApp or not to CouchApp
Date Tue, 02 Aug 2011 01:31:22 GMT
On Mon, Aug 1, 2011 at 2:10 PM, Gregor Martynus <> wrote:
> I had some discussions on the CouchConf last Friday about the pros & cons of
> a CouchApp vs. a traditional 3 tier architecture. I'm new to CouchDB myself,
> I don't have strong opinions yet. My thoughts so far
>   1. portability:
>   a CouchApp has both application logic and data in the same module.
>   Together with its replication features one could very easily take the same
>   app used for a web app and put it into a mobile phone or an enterprise
>   intranet/extranet.

Yes, it's built in, but there are so many other ways to move an app
onto another system that I think this is not as cool as people make it
out to be.

Let's take the mobile example. You still need CouchDB installed, which
by default is not the case. So you still have to install CouchDB
through the app store, and then use some system to replicate CouchDB
into your phone's CouchDB installation. Assuming you must have a
native app and not a web app, it seems like a much better user
experience to download a native app that has CouchDB bundled in and
connect to it on a local port.

>   2. simplicity / reach:
>   It empowers a lot of UI Designers/Developers to build Database backed
>   applications. That's pretty impressive, you know jQuery? You can build
>   couchApps.

Some would say that's a con. I might be one of them, but haven't decided yet.

>   1. security:
>   CouchApp comes with build in signup/signin, but what keeps users to
>   access pages like »/db/_all_docs?include_docs=true« ? There is now way to
>   hide documents created by User A from User B with CouchDB's build in
>   features as far as I understand it.

There isn't, and for good reason. I can't find the group of links
someone collected on why this is, but my favorite example is how you
would enforce a document level ACL when summing values in a document
during map/reduce. For example, you have access to document A (value
1) and B (value 2), but not document C (value 3). After summing the
document's values, would you expect a sum of 3 or 6?

Put a more direct way, there is no link from reduce's values to documents.

>   2. scaleability:
>   there are more possibilities to scale with a 3 tier architecture than
>   there are for CouchApps

It's more that there is no data on how couchapps scale since no one
has put one into production yet (blogs and personal pet projects don't

Another con is that to my knowledge you cannot create very powerful
applications, versus using a full web stack involving PHP, Java, Node,

> What do you think? Do you have a CouchApp running today in Production?
> What's your experience so far?
> I'd be happy to summarize the opinions and put them up on the couchDB wiki
> so that everybody can benefit from it.

That'd be very neat. :)

Side note, I'm creating an event RSVP system for my BBQ this weekend
as a couchapp. I feel like this is roughly the level at which
couchapps live.


Sam Bisbee

View raw message