设计消息队列存储消息的 MySQL 表格

topic【主题】

注:TOPIC_ID 为主键
queue【消息队列表】

注:QUEUE_ID 为主键
${queue_id}_message【消息内容表】

注:MSG_ID 为主键,MSG_SEQ 为唯一键索引。此张表设计为:动态消息表,即为每个队列创建消息内容表,队列数建立的次数非常少。
topic【主题】
注:TOPIC_ID 为主键
queue【消息队列表】
注:QUEUE_ID 为主键
${queue_id}_message【消息内容表】
注:MSG_ID 为主键,MSG_SEQ 为唯一键索引。此张表设计为:动态消息表,即为每个队列创建消息内容表,队列数建立的次数非常少。
评论