views:

539

answers:

5

I am interested in knowing if there are any server-side web application frameworks which integrate nicely with CouchDB? Does anyone have any experience in doing this? It seems like a dynamic language would be well-suited for playing with the JSON, but I am more interested in hearing about how it would fit in with the framework and the application's design.

+2  A: 

Two frameworks that I would suggest for CouchDB are Ruby on Rails and Django. Both have a small file you can include that allows for easy interaction with CouchDB. For Ruby/Rails, this gives you the ability to write code that looks like this (code snippets yanked from here):

# Create the database
server = Couch::Server.new("localhost", "5984")
server.put("/foo/", "")

# Insert a new document into the database
doc = <<-JSON
{"type":"comment","body":"First Post!"}
JSON
server.put("/foo/document_id", doc)

# Get the document back later
res = server.get("/foo/document_id")
json = res.body
puts json

Python/Django lets you do the same with a relatively minimal amount of work (see here). Both of these aren't at the web framework level but they require a minimal amount of work to set up and are pretty easy to get going in Rails and Django. The Django approach still requires some packages to be installed so if you just can't do that for some reason the Rails approach is the way to go.

Another good how-to on Python on Django can be found here (also lifted from the CouchDB FAQ).

Chris Bunch
How would you use the django user system and authentication, authorization? - that depends on django models which depends on sql.
A: 

Depending on what you want to build CouchApp may be something to look at: It's specially designed for writing apps with CouchDB:

http://wiki.github.com/jchris/couchapp/manual

Jeremy Wall
A: 

The only web framework that dedicates itself to CouchDB is currently CouchDBKit for Python.

Check out the official wiki page that lists how to get started in your language:

http://wiki.apache.org/couchdb/Basics

Pick the language and framework that suits you best and then use one of the light CouchDB libraries with it.

It seems that things are move quite quickly at the moment for CouchDB. I'm sure there will be more frameworks out there soon with CouchDB support. I'm currently looking into building one for PHP.

andyuk
A: 

I have had good success with jcouchdb for Java and CouchApp for JavaScript and CouchDBKit with Python. All of these are actively developed, open source and well designed and easy to enhance if they are missing something you really need. I have submitted patches and feature enhancements for jcouchdb and couchapp both.

fuzzy lollipop
A: 

Actually, you don't really need such a framework. Instead, you can just write the whole web application in CouchDB. It allows you to generate HTML files, or any other XML derived format, and you can even use HTML-templates. I consider this a good choice, because JavaScript is a rich and flexible language. On the other hand you don't have the overkill of a connection between the database and your web application.

For more details, check out: http://books.couchdb.org/relax/design-documents/shows

There's also a related question: http://stackoverflow.com/questions/1911226/using-couchdb-to-serve-html

Johann Philipp Strathausen