Storage Plan: Map v/s linear

Rakesh Rajan rakeshxp at
Sun Nov 11 09:13:43 UTC 2007

Dustin, Thanks for the reply!

I think I will stick to my current implementation, which is based on option

But I would also like to know

 - With respect to memcached implementation/performance, if creating max p^2
( or always p^2 ) entries ( with smaller value) worse/better than creating
only max p entries ( but with larger value size ) ?

 - As I already stated in my previous mail, I am assuming average of 200-300
friends per person. Moreover I am planning to use this feature ( my original
question ) to quickly find if there is a relationship from Person A ->
Person B and if so, what type of relation.So considering this, would you
still choose option 1 ?

- For maintaining friends, this cannot be tied to the previous point. To
implement this, again there are couple of ways, for which I would like to
get some feedback/opinion on.
         - Not all friends would be shown at a given time and that means I
would need to implement pagination in UI.
         - The ordering of friends maybe random / some criteria  ( like
currently logged in people first )

     Considering the above requirements, what would be best way to use
memcached for this ? Some ideas that I had
        - Use bucketing in memcache. i.e for a person A , we would have
multiple entries for his/her friends in memcached corresponding to 1-25,
26-50 ( example ) ( Assuming number for friends shown in UI ~25 and ~200-300
friends on average )
        - Problem I see in this method, is ordering the data, like ordering
by lastname and/or last login etc


On Nov 11, 2007 2:30 AM, Dustin Sallings <dustin at> wrote:

> On Nov 10, 2007, at 4:14, Rakesh Rajan wrote:
> > I would like to know which of option is better for my requirement ?
>        I'd probably favor option 1 as a first pass simply because it's
> atomic.  With option 2, you can lose some mappings between a user and
> his friend without knowing it.  You can't tell the difference between
> ``not a friend'' and ``don't know.''
>        Option 1 is heavier if you're just asking if user b is a friend of
> user a when user a has  a lot of friends, but option 2 won't work
> reliably unless you record both friend and known not-friend
> relationships (from max p^2 to always p^2).
> --
> Dustin Sallings
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the memcached mailing list