Dustin, Thanks for the reply!<br><br>I think I will stick to my current implementation, which is based on option 1. <br><br>But I would also like to know<br><br> - 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 ) ?
<br><br> - 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 ? <br><br>- 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.
<br> - Not all friends would be shown at a given time and that means I would need to implement pagination in UI. <br> - The ordering of friends maybe random / some criteria ( like currently logged in people first )
<br> <br> Considering the above requirements, what would be best way to use memcached for this ? Some ideas that I had <br> - 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 )
<br> - Problem I see in this method, is ordering the data, like ordering by lastname and/or last login etc <br> <br>-Rakesh <br><br><div class="gmail_quote">On Nov 11, 2007 2:30 AM, Dustin Sallings <
<a href="mailto:dustin@spy.net">dustin@spy.net</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d"><br>On Nov 10, 2007, at 4:14, Rakesh Rajan wrote:
<br><br>> I would like to know which of option is better for my requirement ?<br><br><br></div> I'd probably favor option 1 as a first pass simply because it's<br>atomic. With option 2, you can lose some mappings between a user and
<br>his friend without knowing it. You can't tell the difference between<br>``not a friend'' and ``don't know.''<br><br> Option 1 is heavier if you're just asking if user b is a friend of
<br>user a when user a has a lot of friends, but option 2 won't work<br>reliably unless you record both friend and known not-friend<br>relationships (from max p^2 to always p^2).<br><br>--<br><font color="#888888">Dustin Sallings
<br><br><br><br></font></blockquote></div><br>