Hi Tito,
The Couchbase implementation for include_docs is different. If you use
an SDK, it requests the view to get all the IDs and then it fetches the
full docs via a memcache GET. In the upcoming version of Couchbase (3.0)
the original include_docs of the views will completely go away aand it
will only be supported through the SDKS (don't worry the API won't
change when you use the SDKS).
> Since Couchbase utilizes memcache, storing and retrieving data is a
> whole different game: while in general a CouchDB document should not be
> split and related into other documents (it's not a RDBMS!), it seems to
> be perfectly fine in Couchbase. Because get/set/multiget are cheap
> operations, it's perfectly feasible to "break" a document into smaller
> pieces and retrieve them piecemeal. It seems this would be great for
> memcache because it'd allow to cache the documents that are used the
> most. On the other hand, keeping a document "monolithic" not only makes
> the index larger, but it makes it less efficient to cache (it's an all
> or nothing proposition.)
>
> So it seems that a valid approach in Couchbase would be to:
>
> 1) break "large" documents into smaller, more manageable ones. Retrieve
> them via get/multiget (cheap op) and let memcache cache them as
> efficiently as possible.
> 2) emit small data subsets as needed, as opposed to the entire document
> where possible.
> 3) for those queries where the entire document needs to be retrieved...
> what then?:
>
> 3.1) should we emit null and include_docs=true?
> 3.2) should we emit the entire document instead?
You would emit null and let the SDK do the rest
> It's clear that always emitting null in CouchDB puts a lot of pressure
> on the storage system. But what about Couchbase? Are there any best
> practices to be followed?
Do you mean "emittin the full document ...."?
Cheers,
Volker