Adventures into CouchDB and Rails

September 4, 2009

Getting ready for CouchDB 0.10

Filed under: CouchDB — zdzolton @ 2:59 am

I’ve setup a local copy of CouchDB, from the 0.10 branch, just to see if my application code could handle its awesome powers. Here are my two big takeaways:

Turn on delayed commits

CouchDB 0.10 now defaults to disabling delayed commits, which in your production environment is a great trade of data consistency for write speed. However ensuring all those bits get flushed out to disk can be quite slow. For example, before turning on delayed commits my slowest unit test took over 12 seconds (ouch!), but after it got down to 3.4 seconds. Moreover, the whole test suite went from over 400 seconds (eek!) down to 90 seconds, after turning that option on.

So make sure to put this into your local.ini for your workstations:

[couchdb]
delayed_commits = true

Review your usage of reduce=false

In CouchDB 0.9 one could always specify reduce=false in view queries—even for views that don’t actually define a reduce function. This will now be considered an invalid query, and CouchDB will respond a 400 HTTP status code. I’m not sure I think it necessary to be so strict here, but all you do is review your database queries to make sure you’re passing reduce=false in erroneously.

I think we’re ready!

Other than this, it took very little to prepare my application for CouchDB 0.10—and I’m pretty excited for the _changes API and no downtime deployment of views!

Advertisements

2 Comments »

  1. […] Getting ready for CouchDB 0.10 I’ve setup a local copy of CouchDB, from the 0.10 branch, just to see if my application code could handle its awesome powers. Here are my two big takeaways… […]

    Pingback by almost effortless » Weekly Digest, 10-12-09 — October 12, 2009 @ 8:18 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: