CouchDesignDocument Usage Questions

32 views
Skip to first unread message

mike

unread,
Apr 13, 2012, 2:47:49 PM4/13/12
to mobile-c...@googlegroups.com
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?

Dave Cottlehuber

unread,
Apr 13, 2012, 3:51:42 PM4/13/12
to mobile-c...@googlegroups.com

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.

A+
Dave

mike

unread,
Apr 14, 2012, 10:47:23 AM4/14/12
to mobile-c...@googlegroups.com
Terrific answer, thanks! 

Reply all
Reply to author
Forward
0 new messages