Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 用户通知系统设计_Php_Design Patterns_Database Design_Notifications - Fatal编程技术网

Php 用户通知系统设计

Php 用户通知系统设计,php,design-patterns,database-design,notifications,Php,Design Patterns,Database Design,Notifications,我正在尝试建立一个用户通知系统(比如facebook) 我有mysql表,简化如下 user : id,username post : id,user_id,text comment:id,user_id,post_id,text post_like:id,post_id,user_id friend:id,owner_id,follower_id 您可以看到表之间的关系。。该通知系统应允许用户跟踪帖子下的评论,该帖子的所有者或触及该帖子(如或评论), 跟踪帖子所有者或触及帖子的帖子上的类似动

我正在尝试建立一个用户通知系统(比如facebook) 我有mysql表,简化如下

user : id,username
post : id,user_id,text
comment:id,user_id,post_id,text
post_like:id,post_id,user_id
friend:id,owner_id,follower_id
您可以看到表之间的关系。。该通知系统应允许用户跟踪帖子下的评论,该帖子的所有者或触及该帖子(如或评论), 跟踪帖子所有者或触及帖子的帖子上的类似动作(如或评论), 通知友谊行动和类似行动

首先我想用另一张表来解决它

notification: id,notification_type,user_owner,user_other,isNotified,date
ntype:id,type (such as friendship,add a comment, like a post etc.)
因此,当用户执行某个操作时,我将在通知表中插入该操作,然后在客户端上,我将使用ajax检查记录的用户是否有任何通知(isNotified=false) 之后,只需更新isNotified=true

在这种情况下,我如何通知其他接触帖子(评论或喜欢)的用户。。在这种情况下,只是通知邮件的所有者

同时,在我研究发现的同时,我认为这是实现类似功能的更好方法。。那么,你能给出一些关于如何填写通知单的细节吗

我还对它的性能问题感到好奇。。假设有10万用户,每个用户有10篇帖子和100条评论,每天都喜欢。那么会发生什么? 我应该考虑一些NoSQL解决方案,比如NeX4G或MunGDB吗? 谢谢