Intersect query performance/ finding "mutual friends".

65 views
Skip to first unread message

emiretsk

unread,
Feb 1, 2012, 9:53:36 PM2/1/12
to FlockDB
Hi,

How is the intersect query functionality implemented under the hood?
How good is the performance? The simple approach would be to just do 2
"friends" queries (1 for each user) and do a simple intersect
operation on the results in memory. Is there more to it?

I am building an application that requires finding mutual friends,
interests, etc. I was under the impression that a mySQL,
implementation will have bad performance as the application scales( an
inner join on huge tables) and was considering using Redis/Cassandra/
Hbase. But if FlockDB is good enough for twitter it is clearly good
enough for me, so I am starting to reconsider my options.

To give it more context I am developing a facebok app.The user should
be able to search other users and in the search results page see how
many common friends/event/etc. he has with each user. Preferably, the
app should also be able to sort the results using a mix of the number
of common friends with some other application specific data.

From what I have read online, Facebook seems to pre-calculate the
mutual friends for each pair of users. Digg does the same thing for
"friends that like this article".

Is it realistic to be able to calculate mutual friends "live" using
flockDB?

Does anybody have any advice on how to design the "mutual friends"
functionality using FlockDB? As well as the tradeoffs compared to
using the Facebook/Digg approach?

Regards,
Eugene
Reply all
Reply to author
Forward
0 new messages