denormalize. If you do, I'd recommend storing a given user's feed in
On Jul 4, 9:05 am, Martin Wawrusch <
mar...@wawrusch.com> wrote:
> here is a detailed discussion of the topic, although not mongodb specific:
>
>
> HTH
> Martin
>
>
>
>
>
>
>
> On Mon, Jul 4, 2011 at 5:58 AM, Sam Millman <
sam.mill...@gmail.com> wrote:
> > "At first glance, I'm thinking of having a feed array field on User,
> > and populating it whenever a friend creates a post. But if a user has
> > hundreds of friends, will this become costly (as it will need to post
> > to all of the friends' feeds)?"
>
> > You mean putting all wall posts within a field within the user document.
>
> > If so that will not work because:
>
> > - Document size is only 16meg
> > - Sorting and picking out individual wall posts etc would be too tiresome
> > and expensive.
>
> > You will need two collections. One for user and one for wall and one for
> > friends.
>
> > You gather together all the friend ids and then search for wall posts that
> > are from that user and are not private or directly to another user that is
> > not the one viewing.
>
> > This is only a basic outline of what to do but should be enugh to get you
> > on your way.
>
> > Hope this helps,
>