I have been playing with CouchDB and CouchApp for a little while now. I am planning on using it for a new web site project I\'m working on.
From a scalability vi
Because CouchDB uses an HTTP-based API there are several ways to "mix and match" server-side code (node.js, PHP, etc) with your CouchApp.
I break the options down into three categories:
You can find out more about the _changes feed and _external handlers below:
For what its worth, I'll be discussing these three options this coming Wednesday in a PHP and CouchDB Webcast. Your questions would be a valuable addition to the discussion at the end of the webcast.
I'd love to know how your CouchApp turns out, and how you solve the problems you mentioned above.
Excellent answer from BigBlueHat, but I have one more more possible option to add:
Overcome the cross-domain problem, thereby allowing you to serve pages from any sort of web server, and also allowing the browser to interact directly with CouchDB ( which can be on another server ).
The cross-domain restriction, as enforced by browsers, is not that hard to get around. The 2 main methods that I know of are: JSONP and CORS.
JSONP disguises each request as "script" request ( as script requests are exempt from the cross-domain rule). It only works for GET, not POST or PUT or anything else. You can do it with jQuery.
CORS is "Cross Origin Resource Sharing", and it is simply a special HTTP Header that must be implemented on the server ( couchdb in this case ), which tells the browser that it's OK -- it doesn't mind serving requests that come from another domain. I have tested this, and it does work, but there might be security issues -- I am not sure.
So...I don't know whether it's a good idea, but it is technically possible to ( at least partially ) overcome the cross-domain restriction with CouchDB. Has anyone ever built a system using this type of setup?