架构训练营 - 模块八作业
项目背景

方案概述
所有消息存放一张表
演进思路(不能满足存储性能要求时)
按时间拆分表,如:每天一张消息表
按类主题分表,如:每个主题一张消息表
表设计
消息表设计

索引说明:
1. 主键索引:消息编号
确保消息唯一性
2. 多列索引:主题编号+消息状态
实现运维系统根据主题查询或统计消息,以及实现根据状态重试消息发布
消费记录表

索引说明:
1. 主键索引:记录编号
确保消费记录唯一性
2. 聚集索引:消息编号+消费状态
实现运维系统根据消息编号 或 消费状态查询 消费记录
评论