Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Couchapp a realistic substitution for a web framework? [closed]

Assuming you're going to use couchdb, is it realistic to try to just use couchapp in place of django, rails, or asp.net mvc? What would be the benefits and drawbacks?

like image 203
Joe Webb Avatar asked May 02 '11 14:05

Joe Webb


1 Answers

Yes, normally a CouchApp would use AJAX for the whole application, though that's not a requirement. It's possible to create a CouchApp that will provide a fallback and render the core content for browsers without JS (and search engines).

This is normally a little complicated and involes writing your rendering functions twice. Once in the design doc as a show or list function, then again for your client-side code. However, I've been working on a CouchApp framework called Kanso, which allows you to write code once and have it run on the client-side when possible and fall-back to CouchDB when that's not.

Another problem I've found with CouchApps is that the validation and permissions code can get very complicated quickly with a bigger app. So Kanso also provides Type definitions similar to other Model systems you might have used in Django or Rails.

Just to be clear: You will not achieve the same experience for browsers without JS, but what you can do is render the basic content of the page and then progressively enhance it with JavaScript.

This is what Kanso was designed for :)

like image 130
Caolan Avatar answered Oct 18 '22 10:10

Caolan