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>&nbsp;- 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>&nbsp;- 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 -&gt; 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Not all friends would be shown at a given time and that means I would need to implement pagination in UI. <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - The ordering of friends maybe random / some criteria&nbsp; ( like currently logged in people first )
<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  <br>&nbsp;&nbsp;&nbsp;&nbsp; Considering the above requirements, what would be best way to use memcached for this ? Some ideas that I had <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - 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>&nbsp; &nbsp; &nbsp; &nbsp; - Problem I see in this method, is ordering the data, like ordering by lastname and/or last login etc &nbsp;  <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>-Rakesh &nbsp;&nbsp;&nbsp; <br><br><div class="gmail_quote">On Nov 11, 2007 2:30 AM, Dustin Sallings &lt;
<a href="mailto:dustin@spy.net">dustin@spy.net</a>&gt; 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>&gt; I would like to know which of option is better for my requirement ?<br><br><br></div> &nbsp; &nbsp; &nbsp; &nbsp;I&#39;d probably favor option 1 as a first pass simply because it&#39;s<br>atomic. &nbsp;With option 2, you can lose some mappings between a user and
<br>his friend without knowing it. &nbsp;You can&#39;t tell the difference between<br>``not a friend&#39;&#39; and ``don&#39;t know.&#39;&#39;<br><br> &nbsp; &nbsp; &nbsp; &nbsp;Option 1 is heavier if you&#39;re just asking if user b is a friend of
<br>user a when user a has &nbsp;a lot of friends, but option 2 won&#39;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>