How does couchbase distribute the index files?


#1

Hi,

I want to know more about the distribution architecture of couchbase’s views. Are all key/value stored in the same node as their documents? Or, are all key/value pairs shared with the same key stored in a same node (or vBucket)?

thanks,

Lenx


#2

A document’s key and value are both stored in the same vBucket. If you think about it, storing them in different vBuckets wouldn’t be very helpful as you’d have to potentially go to two different vBuckets to read a whole document.

If you’re interested, more details are available in the Architecture whitepaper: http://www.couchbase.com/sites/default/files/uploads/all/whitepapers/Couchbase_Server_Architecture_Review.pdf


#3

Thanks, Dave. So for views with reduce functions, the server needs to re-reduce across nodes for every query, right?


#4

It will need to re-reduce across all nodes, yes when the view is updated. The result is cached however so subsequent accesses of the view (before the next view update) can be quickly returned.