What is the best way to store user relationships, e.g. friendships, that must be bidirectional (you\'re my friend, thus I\'m your friend) in a rel. database, e.g. MYSql?
<
Using double rows, while it creates extra data, will greatly simplify your queries and allow you to index smartly. I also remember seeing info on Twitter's custom MySQL solution wherein they used an additional field (friend #, basically) to do automatic limiting and paging. It seems pretty smooth: https://blog.twitter.com/2010/introducing-flockdb