What is the best way to store ordered documents in CouchDB?
Say I have 100 articles and I want to order them by just visibly placing them in an order I like, or I have 10,000 images and I want them to appear in a specific order other than by date/category/etc. Is this best stored at the parent ("page" or "album" level), or child (image/article) level?
Should it be more like this:
{
_id: myPage;
articles: [myArticle14, myArticle5, myArticle2, myArticle20...];
}
or this:
{
_id: myArticle14;
position: 1;
}
... where articles: [myArticle14, myArticle5, myArticle2, myArticle20...];
are the _id
's of te actual Article documents.
What are the benefits/drawbacks of each, and which do you find is easier to use as the app grows?