shintei Posted February 9, 2011 Share Posted February 9, 2011 So for a web system I have been building, I want to use a news feed system that displays whats happened that involves the user while they where away/logged out Ex. Sue has sent you a message Bobby has invited you to an event My question is on how others would normally store this. My first though was to make a table which would hold one row per user. The row would then have two column, one called feed which would hold a concatenated listing of events that have occurred. The issue with that though is it would be a pain to try and remove old feeds. I don't need to store things that happened a month ago. I also though of inserting a new row for each event, and then have a script that runs every so many days deleting feeds that are of X days old. The problem with this though, is I imagine that the table could get pretty large and could cause a lot of Overhead (correct me if I am wrong). Does anyone know how this is usually done? I also apologizes in advance if this topic has been discussed prior. I did a quick search but didn't find much. Quote Link to comment https://forums.phpfreaks.com/topic/227193-news-feed-database-implementation/ Share on other sites More sharing options...
lastkarrde Posted February 9, 2011 Share Posted February 9, 2011 Your way sounds fine. The table itself would only have 5 or so columns (ids of user, time created). All modern databases can store tens of millions of rows no problem, especially if the data is very basic (like it is here). Quote Link to comment https://forums.phpfreaks.com/topic/227193-news-feed-database-implementation/#findComment-1172046 Share on other sites More sharing options...
Jessica Posted February 9, 2011 Share Posted February 9, 2011 I agree, this is how I've done similar features. Quote Link to comment https://forums.phpfreaks.com/topic/227193-news-feed-database-implementation/#findComment-1172057 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.