CouchDesignDocument Usage Questions

Showing 1-3 of 3 messages
CouchDesignDocument Usage Questions mike 4/13/12 11:47 AM
I know I can but when should I use multiple design documents in a single database?  Is there a performance (or other) advantage over using a single design document?  I am correct in assuming this is optional?
Re: CouchDesignDocument Usage Questions Dave Cottlehuber 4/13/12 12:51 PM

Yup it's optional.

A few considerations;

#1 a ddoc replicates as a single document, so if this is important, keep
dependent code in the same ddoc. A classic case is having validation
functions out of sync of incoming docs if you have them in separate ddocs.

#2 all code in the ddoc needs to match. For example, the first line is
"language": "javascript" so if you want an erlang-based view or maybe
you've stashed python in there, then you need a separate ddoc.

#3 rebuilding a view triggers updates for all views in that ddoc. In most
cases this is what you want to do anyway.

I've no idea how this compares to mobile couchbase so maybe there
are other things to consider.


Re: CouchDesignDocument Usage Questions mike 4/14/12 7:47 AM
Terrific answer, thanks!