DB structure for Twitter home/Facebook wall?
- by mathon12
Basically a live feed of all your friends' recent posts.
In a stupid sort of approach I think I'd start by building a query like:
SELECT * FROM tblposts WHERE userid=friend_id_1OR userid=friend_id_2...... and so on
Where friend_id_% is the userid of a friend from your friends list. But this must be a very inefficient way of doing it, right? Is there any faster way of doing this in MySQL? Maybe some clever DB schema?
(I know FB uses Hadoob but I'm not experienced enough to go that far :( )