incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anh <7za...@gmail.com>
Subject Re: Need advice about docs structure design.
Date Thu, 17 Jun 2010 21:39:53 GMT


On Jun 17, 2010, at 1:37 PM, faust 1111 <faust451@gmail.com> wrote:

> If i keep  them in the same database
> What about view speed?

I would recommend not trying to 'pre-optimize' for view performance, if it means bifurcating
interrelated data across DBs

With that said, if you really want to split the DBs, you could make multiple client requests,
and do the 'join' in the client

> 
> Example users add many bookmarks and when try fetch Posts each
> bookmark processed by this view but it's unnecessary it's slow down my
> views is not it?.
> 
> 
> 2010/6/18 J Chris Anderson <jchris@gmail.com>:
>> 
>> On Jun 17, 2010, at 1:15 PM, faust 1111 wrote:
>> 
>>> Hy guy's.
>>> 
>>> My model:
>>> Users has
>>>  Bookmarks and Posts
>>> 
>>> have idea keep Bookmarks and Posts in separate DB (for speed views).
>>> But in view i want fetch Bookmarks and Posts with user name,
>>> 
>> 
>> You should keep them in the same database (replication is easier, too) and then use
this kind of query:
>> 
>> http://www.cmlenz.net/archives/2007/10/couchdb-joins
>> 
>>> In what way i can do this?
>>> keep copy of users in each DB?
>>> 
>>> or may be keep users in separate DB, fetch bookmarks or posts and then
>>> fetch users and then merge?
>>> 
>>> Yes i know i can copy user name to doc, but have a trouble when user
>>> name is changed (it's force me use stale=ok in request view
>>> +background process to track changes and run rebuild index).
>>> 
>>> I think it's will be cool crazy stuff if i can update docs(cached
>>> fields - not have effect to index) and say Couch you don't need
>>> rebuild index relax ;).
>>> 
>>> Any advice?
>> 
>> 

Mime
View raw message