June, 2009

Efficiently Serving CouchDB Attachments with Rails and nginx (2009-06-16)

I’m working on a project built in Rails where the data storage is being handled by CouchDB instead of a conventional SQL database. Thanks to Ruby’s dynamic nature, we can disable ActiveRecord and the rest of Rails is just fine seeing subclasses of CouchRest’s ExtendedDocument instead of ActiveRecord::Base.

One of the nice things about CouchDB, and one which is quite helpful for our project, is its ability to store file attachments in the database. This is less effort than mucking about keeping files in the filesystem. Unlike BLOB columns in SQL, the file attachments are not given to the application unless specifically requested, which reduces the odds of unnecessarily transferring a lot of ignored data from the database.

Read more… View Comments