Facebook as a notification system

I am developing facebook as a notification module in php / mysql where the user is notified of the latest events among his friends (added photo / added video / comment, etc.). What is the best approach to developing this module from a database perspective. Do I need to have a separate table for each type of activity (for example, photographs). Or one table is enough.

And what is the best logic. One option is that every time a user performs an action, this activity can be inserted into a table with all the identifiers of friends, that is, if he has 50 friends, 50 records. Thus, no php script is required, just scan the table when the user logs in. The second option is when the user logs in, looks at his friends, stores in the array and looks at the notification table for each friend, regardless of whether the friend has taken any actions.

Thanks in advance, Hari

+3
source share
2 answers

, IS-A ( " " ). , type - .

. , , 50 ? ... , .

+1

. , "". , , ( ) "" .

+1

Source: https://habr.com/ru/post/1725149/


All Articles