You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Hadley Wickham <ha...@rice.edu> on 2009/09/01 18:35:05 UTC

Views per design doucment

Hi all,

I'm confused about how I should split my views up between design
documents.  I understand that the all the views in a design document
are reindexed together, but this doesn't give me any feel for how I
should split views up across design documents.  My feeling is to stick
with one view per design document, unless there is some compelling
reason otherwise (e.g. minor variations on the same theme).  Is this
what other people do?  Any suggestions?

Thanks,

Hadley

-- 
http://had.co.nz/

Re: Views per design doucment

Posted by Chris Anderson <jc...@apache.org>.
On Tue, Sep 1, 2009 at 10:14 AM, hadley wickham<h....@gmail.com> wrote:
> So if only one application is using the database (at the moment), I'd
> have only one design document?  And do you mean application in the
> broad sense (i.e. any client of the database) or just couchdb
> applications?
>
> Hadley

There are two factors: performance and simplicity.

Generally you'll get better of both by having a small # of design docs. (eg: 1)

The exception to this rule is when you are developing a new view
against an existing large database that already has views. In this
case it can be a pain to lose the existing indexes just because you
want to add a new one. You can (A) work on a smaller development
database or (B) deploy the new view to it's own ddoc.

In production (when view definitions have stabilized) you'll likely
want to use a single ddoc, as it will generate faster and take less
space on disk.

Of course, these are extremes and maybe you'd want to have user views
in one ddoc and admin views in another... that sort of split can give
you more simplicity depending on your application.

Chris

>
> On Tue, Sep 1, 2009 at 12:07 PM, Zachary Zolton<za...@gmail.com> wrote:
>> Basically, each application that uses a database should correspond to
>> a different design doc:
>>
>> http://books.couchdb.org/relax/design-documents/design-documents#Applications%20are%20Documents
>>
>> On Tue, Sep 1, 2009 at 11:35 AM, Hadley Wickham<ha...@rice.edu> wrote:
>>> Hi all,
>>>
>>> I'm confused about how I should split my views up between design
>>> documents.  I understand that the all the views in a design document
>>> are reindexed together, but this doesn't give me any feel for how I
>>> should split views up across design documents.  My feeling is to stick
>>> with one view per design document, unless there is some compelling
>>> reason otherwise (e.g. minor variations on the same theme).  Is this
>>> what other people do?  Any suggestions?
>>>
>>> Thanks,
>>>
>>> Hadley
>>>
>>> --
>>> http://had.co.nz/
>>>
>>
>
>
>
> --
> http://had.co.nz/
>



-- 
Chris Anderson
http://jchrisa.net
http://couch.io

Re: Views per design doucment

Posted by hadley wickham <h....@gmail.com>.
So if only one application is using the database (at the moment), I'd
have only one design document?  And do you mean application in the
broad sense (i.e. any client of the database) or just couchdb
applications?

Hadley

On Tue, Sep 1, 2009 at 12:07 PM, Zachary Zolton<za...@gmail.com> wrote:
> Basically, each application that uses a database should correspond to
> a different design doc:
>
> http://books.couchdb.org/relax/design-documents/design-documents#Applications%20are%20Documents
>
> On Tue, Sep 1, 2009 at 11:35 AM, Hadley Wickham<ha...@rice.edu> wrote:
>> Hi all,
>>
>> I'm confused about how I should split my views up between design
>> documents.  I understand that the all the views in a design document
>> are reindexed together, but this doesn't give me any feel for how I
>> should split views up across design documents.  My feeling is to stick
>> with one view per design document, unless there is some compelling
>> reason otherwise (e.g. minor variations on the same theme).  Is this
>> what other people do?  Any suggestions?
>>
>> Thanks,
>>
>> Hadley
>>
>> --
>> http://had.co.nz/
>>
>



-- 
http://had.co.nz/

Re: Views per design doucment

Posted by Zachary Zolton <za...@gmail.com>.
Basically, each application that uses a database should correspond to
a different design doc:

http://books.couchdb.org/relax/design-documents/design-documents#Applications%20are%20Documents

On Tue, Sep 1, 2009 at 11:35 AM, Hadley Wickham<ha...@rice.edu> wrote:
> Hi all,
>
> I'm confused about how I should split my views up between design
> documents.  I understand that the all the views in a design document
> are reindexed together, but this doesn't give me any feel for how I
> should split views up across design documents.  My feeling is to stick
> with one view per design document, unless there is some compelling
> reason otherwise (e.g. minor variations on the same theme).  Is this
> what other people do?  Any suggestions?
>
> Thanks,
>
> Hadley
>
> --
> http://had.co.nz/
>