I just read the following posts on the same topic:
Facebook like notification tracking (database design) and Database design for storing notifications to users
Some solutions were proposed, but not quite what I needed, and how it should be for Facebook's notification system.
In a notification, we often have links pointing to the user who took some action, a link to a message or video that he commented on, a link to anything, and we have several links in one notification.
notification ----------------- id (pk) userid notification_type notification_text timestamp last_read
With this table structure, we can show all notifications for one user, and this is a pretty solid solution. But in this case, we can only display a text notification. We cannot just refer to a user or wall.
I am trying to find a solution to this problem. One of them is to store BB codes in the notification_text property, but then you need to write a BB parser for both web applications and mobile applications. Another will be the creation of another table, which is obtained from this notification table with an identifier for the objects that we need. Example:
PostCommentNotification : Notification ---------------------------------------- id userId (user who commented on a wall post) postId (post where comment was made)
Now we can write a template to display the notification (now we no longer need a text property in the notification table), and then process its display. I am not satisfied with this decision either because the number of tables obtained from the notification table may be large (for each type of notification).
I'm looking for ideas! :)
Nebojsa veron
source share