当前位置:网站首页>Design a MySQL table for message queue to store message data

Design a MySQL table for message queue to store message data

2022-06-12 22:07:00 InfoQ

Homework : Design message queue to store message data  MySQL  form
【 Job requirements 】
1.  Include table name 、 Field 、 Indexes ;
2.  Use words to describe the design ideas and reasons , for example : Why design an index ?
3.  One page  PPT  that will do .
【 Tips 】
1.  You need to consider one table per message queue , Or put all the messages in one table , Add a “ Queue name ” Field of .

design scheme :

1. Each message queue defines a set of message table names and archived message table names ;
2. After receiving the message, the message queue stores it in the defined message table to be consumed , The consumed messages are transferred to the archive table , Ensure efficient query and writing of message table

Message queue definition table


Message table to be consumed

unique index : message_id, Make sure the whole situation is unique
General index :topic

Message archive table ( News of consumption )

unique index :message_id





原网站

版权声明
本文为[InfoQ]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/163/202206122155504246.html