> 文档中心 > php程序设计 - 高并发系统消息模块支持百万级日活

php程序设计 - 高并发系统消息模块支持百万级日活

大纲

  • 业务需求分析
    • 消息表notice
    • 关联用户的接收表user_notice
    • 订阅式模式设计

业务需求分析

平台需要发布系统消息给全部用户,也可以发送部分用户,也可以单一用户。
通知消息分 1 一般消息 2、重要通知 3、处罚公告 4个人消息 这四种消息类型 。1 、2、 3 是全体用户都可以看到,个人消息只有接收人能看到

图片仅供参考

消息表notice

notice_id int(11) not null
type tinyint(1) not null default 0
title varchart(150) not null default ‘’
contents text not null
create_datetime datetime default null

关联用户的接收表user_notice

id int(11) not null
user_id int(11) not null default 0,
notice_id int(11) not null default 0
if_read tinyint(1) not null default 0,
create