php - How to Facebook like newsfeed? -


How can I apply a Facebook news feed as a feature in my PHP based community application? For example, "X user uploaded a new photo, participating in an event". Receiving this data from different tables consumes a lot of resources.

Thank you.

There you can do a couple of different ways, but I would like to suggest that this is the one . Place a single 'history' table in which details of action were taken with flags (or predefined keys) for all records, a timestamp, and what type of action took place for each user. This will allow you to query a single table for specific types of tasks and to select a set frame of time to display. However, this table will increase faster with so many users so that you can consider sticking to the old data that you know you will not use again later. Pay attention to the index to keep questions intensified, and consider using query caching as you probably will often produce the same results.

As long as you are not planning to use this historical data for auditing users, the action should be OK to dump it after a while. If you need an audit trail then you may have to consider creating a temp_history table to show recent actions and then have to move their recent works into a cron in a permanent audit table for long term storage.


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -