jonniejoejonson Posted December 18, 2008 Share Posted December 18, 2008 A site like facebook allows users to view their recent activity. Do they have a table called recentActivity? or do they simply join all the tables together and get the 10 most recent activities for this user from this joined table? thanks to any responders J. Quote Link to comment https://forums.phpfreaks.com/topic/137469-solved-recent-activity-table/ Share on other sites More sharing options...
JonnoTheDev Posted December 18, 2008 Share Posted December 18, 2008 They could do either but the latter seems the most feasible. Only the facebook developers could tell you this. Quote Link to comment https://forums.phpfreaks.com/topic/137469-solved-recent-activity-table/#findComment-718781 Share on other sites More sharing options...
jonniejoejonson Posted December 19, 2008 Author Share Posted December 19, 2008 So if you were designing a recent activities, you would do it by joining all tables together and then getting that users most recent activities?.. thanks for the response by the way. Quote Link to comment https://forums.phpfreaks.com/topic/137469-solved-recent-activity-table/#findComment-719350 Share on other sites More sharing options...
xtopolis Posted December 19, 2008 Share Posted December 19, 2008 Facebook is huge. Their databases are mirrored, and so the "most recent activity" is not always the most recent. To say you should JOIN all your tables really depends on your structure. Do you have multiple tables that have their own events? Or do you have one common table where events are published? If you had the first design, then you would probably have to do something like what was said above.. but if you had the latter, you would only select the 10 most recent events.. So, it depends on your design. Quote Link to comment https://forums.phpfreaks.com/topic/137469-solved-recent-activity-table/#findComment-719361 Share on other sites More sharing options...
jonniejoejonson Posted December 19, 2008 Author Share Posted December 19, 2008 i have for example an images table. a videos table. a friends table etc... each table has a user_id and a date fields. therefore i could just inner join all the tables along userId and then select the 10 most recent activities for a user. However facebook have the option to delete any recent activities, therefore this would require all my tables have a field that states whetehr a user has choosen to delete this from there recentacitivites. therefore i would assume that facebook would have an entire table dedicated to recent activities.. i may well be wrong.. what do you think?... thanks J. Quote Link to comment https://forums.phpfreaks.com/topic/137469-solved-recent-activity-table/#findComment-719462 Share on other sites More sharing options...
fenway Posted December 19, 2008 Share Posted December 19, 2008 Don't model anything facebook does for your site, or vice versa. It doesn't apply. Quote Link to comment https://forums.phpfreaks.com/topic/137469-solved-recent-activity-table/#findComment-719670 Share on other sites More sharing options...
jonniejoejonson Posted December 19, 2008 Author Share Posted December 19, 2008 thanks for your response, but i am self taught and was wandering how to go about something... was just using facebook as an example because it is doing the same thing that im trying to do. so would you use a seperate table? or simply join all the tables?... thanks J Quote Link to comment https://forums.phpfreaks.com/topic/137469-solved-recent-activity-table/#findComment-719794 Share on other sites More sharing options...
fenway Posted December 19, 2008 Share Posted December 19, 2008 You could simply update a recent activities table, I suppose. Quote Link to comment https://forums.phpfreaks.com/topic/137469-solved-recent-activity-table/#findComment-719821 Share on other sites More sharing options...
jonniejoejonson Posted December 20, 2008 Author Share Posted December 20, 2008 thanks for your response... but you dont sound convinced... like i said i am self taught so i am simply guessing as to what would be best... if you were trying to create a recents activity would you create a seperate table for it? thanks... J Quote Link to comment https://forums.phpfreaks.com/topic/137469-solved-recent-activity-table/#findComment-720051 Share on other sites More sharing options...
JonnoTheDev Posted December 20, 2008 Share Posted December 20, 2008 if you were trying to create a recents activity would you create a seperate table for it yes Quote Link to comment https://forums.phpfreaks.com/topic/137469-solved-recent-activity-table/#findComment-720245 Share on other sites More sharing options...
jonniejoejonson Posted December 20, 2008 Author Share Posted December 20, 2008 thanks neil. Quote Link to comment https://forums.phpfreaks.com/topic/137469-solved-recent-activity-table/#findComment-720390 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.