当前位置:网站首页>消息队列消息数据存储MySQL表设计
消息队列消息数据存储MySQL表设计
2022-07-31 14:21:00 【InfoQ】
1. 介绍
- 消息生产者可创建队列主题,并把消息提交到自定义的队列主题。
- 消息消费者从主题队列中提取消息。
- 队列中的消息可以只被消费一次、也可以被多个消费者阅读。
2. 消息队列数据表设计

3. 关键设计
3.1 使用同一库表存储所有主题
- 每个队列主题使用一张表
- 所有队列主题放在同一张表
3.2 数据库表Sharding
- 提高性能,每张表存储部分消息,提高消息读取查询速度。
- 方便数据集群化,当建立集群时,只需把部分表移动到其他服务器上。
- 方便数据备份,可以备份更新的数据,无需重新备份整个表。
- 方便丢弃旧消息,已经消费的旧消息根据需求可以被删除,把过期的表删除即可。
- 随机,把消息存在当前使用中的数据表中。
- 哈希,对主题计算哈希值,并根据哈希值把消息存储在相应的数据表中。
3.2 索引
边栏推荐
- ERROR: Failed building wheel for osgeo
- Introduction to BigDecimal, common methods
- In the future, the interviewer asks you why it is not recommended to use Select *, please answer him out loud!
- C# Get network card information NetworkInterface IPInterfaceProperties
- AI cocoa AI frontier introduction (7.31)
- Asynchronous processing business using CompletableFuture
- Uniapp WeChat small application reference standard components
- 49.【拷贝构造函数与重载】
- Redis与分布式:集群搭建
- 为什么要分库分表?
猜你喜欢

I summed up the bad MySQL interview questions

uniapp微信小程序引用标准版交易组件

已解决(pymysqL连接数据库报错)pymysqL.err.ProgrammingError: (1146,“Table ‘test.students‘ doesn‘t exist“)

深度剖析 Apache EventMesh 云原生分布式事件驱动架构

推荐系统-召回阶段-2013:DSSM(双塔模型)【Embedding(语义向量)召回】【微软】

1-hour live broadcast recruitment order: industry leaders share dry goods, and enterprise registration is open丨qubit · point of view

Nuget打包并上传教程

Combination series - there are combinations when there are arrangements

一篇文章讲清楚!数据库和数据仓库到底有什么区别和联系?

"Listen to me, thank you" can be said in ancient poetry?Tsinghua University has developed an artifact of "Searching Sentences According to Meaning", which can search for the famous sayings you want wi
随机推荐
Shell script classic case: backup of files
Sentinel服务熔断和降级
Miller_Rabin 米勒拉宾概率筛【模板】
拥塞控制,CDN,端到端
OAuth2:搭建授权服务器
MySql总结
对数字化时代的企业来说,数据治理难做,但应该去做
Redis与分布式:主从复制
[Pytorch] F.softmax() method description
Spark学习(2)-Spark环境搭建-Local
The magic of SQL MERGE statement (detailed instructions)
Resnet&API
Use of C# Assembly
csdn发文助手问题
OAuth2:四种授权方式
Uniapp WeChat small application reference standard components
The use of thread pool two
推荐系统-召回阶段-2013:DSSM(双塔模型)【Embedding(语义向量)召回】【微软】
【Pytorch】F.softmax()方法说明
UnityShader入门学习(三)——Unity的Shader