Hi,
I am developing a face book like notification module in php/mysql where in the user is notified with the latest activities among his friends (Added Photo/Added Video/Commented etc....). What is the best approach to design this module in terms of database. Does it need to have a seperate table for each activity(say photos). Or a single table is enough.
And, what is the best logic. One option is whenever a user performs an action, that activity can be inserted into table with all the friend ids, i.e. if he has 50 friends, 50 records. In this way no php script is needed, just scan the table when user login. Second option is whenever a user login, scan his friends, store in an array & scan the notification table for every friend whether the friend has done any activities.
Thanks in advance, Hari