当前位置:网站首页>Message queue data storage MySQL table design
Message queue data storage MySQL table design
2022-07-31 14:26:00 【InfoQ】
1. Introduction
- Message producers can create queue topics and submit messages to custom queue topics.
- The message consumer pulls the message from the topic queue.
- The messages in the queue can be consumed only once or read by multiple consumers.
2. Message queue data table design

3. Key design
3.1 Use the same library table to store all topics
- One table per queue theme
- All queue themes are placed in the same table
3.2 Database Table Sharding
- Improve performance, store some messages in each table, and improve the speed of message reading and query.
- It is convenient for data clustering. When establishing a cluster, only some tables need to be moved to other servers.
- Convenient for data backup, you can back up updated data without re-backing up the entire table.
- It is convenient to discard old messages. Old messages that have been consumed can be deleted according to requirements, and the expired table can be deleted.
- Randomly store the message in the currently usedin the data sheet.
- Hash, calculate the hash value for the topic, and store the message in the corresponding data table according to the hash value.
3.2 Index
边栏推荐
猜你喜欢

MySQL 23道经典面试吊打面试官

使用NVM进行node版本切换管理

新款现代帕里斯帝预售开启,安全、舒适一个不落

Open Inventor 10.12 Major Improvements - Harmony Edition

技能大赛训练题:登录安全加固

Nuget打包并上传教程

UnityShader入门学习(二)——渲染流水线

Analysis of the startup source code of hyperf (2) - how the request reaches the controller

How to grab configuration information for DELL SC compellent storage system

以后面试官问你 为啥不建议使用Select *,请你大声回答他!
随机推荐
An article makes it clear!What is the difference and connection between database and data warehouse?
技能大赛训练题:ftp 服务攻防与加固
纸质说明书秒变3D动画,斯坦福大学吴佳俊最新研究,入选ECCV 2022
Shell脚本经典案例:探测批量主机是否存活
AWS实现定时任务-Lambda+EventBridge
Linux bash: redis-server: 未找到命令
UnityShader入门学习(一)——GPU与Shader
技能大赛dhcp服务训练题
Description of Hikvision camera streaming RTSP address rules
Shell script classic case: detecting whether a batch of hosts is alive
AI cocoa AI frontier introduction (7.31)
MySQL【聚合函数】
尚硅谷-JVM-内存和垃圾回收篇(P1~P203)
ERROR: Failed building wheel for osgeo
MySQL 23 classic interviews hang the interviewer
拥塞控制,CDN,端到端
LeetCode rotate array
ML、DL、CV常见的问题整理
Miller_Rabin Miller Rabin probability sieve [template]
Analysis of the startup source code of hyperf (2) - how the request reaches the controller