incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin R. Coombes" <>
Subject Re: multiple database or many doc types in one database?
Date Thu, 17 Mar 2011 14:48:45 GMT

On 3/17/2011 3:46 AM, Paul Hirst wrote:
> On Thu, 2011-03-17 at 04:51 +0000, Dominic Tarr wrote:
>> is it a good idea to
>>    1. separate documents for different types of thing into different
>> databases?
>> or is it better to
>>    2. just have a type='whatever' and check for that in your views?
> I am using option 2. I prepend type_ to my ids to avoid keys clashing
> and also have a type field in the body which I use in my views.
> However I'm really regretting doing it this way as I only have two
> documents types. I have 0.25 million of type A and 28 million of type B.
> I often want to change the views regarding type A documents and have to
> wait about 12 hours for it to rebuild. If I had separate databases this
> would be far less of a problem as the type A views would rebuild in a
> few minutes.
What happens if you simply seprate the views into two different design 
documents?  If the views for type A were in one design document, then 
you would at least avoid rebuilding the views that work with type B 
(which at least suggest that the only time hit would come from having to 
execute "if (type == 'A') emit(stuff)" on the type B documents.

> If it wasn't such a large database I would be quite happy with option 2
> so, as usual, the best choice depends on your situation.
> Sophos Limited, The Pentagon, Abingdon Science Park, Abingdon, OX14 3YP, United Kingdom.
> Company Reg No 2096520. VAT Reg No GB 991 2418 08.

View raw message