当前位置:网站首页>Module 8 job message data MySQL table design
Module 8 job message data MySQL table design
2022-07-26 18:36:00 【InfoQ】
Job requirements

Table design
Ideas
- Performance considerations , Use one table per queue
- Businesses often query data through the timestamp of messages , So here it is timestamp Field creation index
- Messages have three states :NEW, ACKED, DELETED
DDL
CREATE TABLE `message_topic_x` (
`id` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
`message_body` text NOT NULL,
`status` enum('NEW','ACKED','DELETED') NOT NULL DEFAULT 'NEW',
`publisher` varchar(200) DEFAULT NULL,
`published_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`acted_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `idx_published_at` (`published_at`),
KEY `idx_acted_at` (`acted_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;边栏推荐
- How to design test cases well
- [kitex source code interpretation] service discovery
- During the oppo interview, 16 questions were thrown over. I was stupid
- Become a test / development programmer, Xiao Zhang: reality is coming
- Leetcode 50 day question brushing plan (day 4 - longest palindrome substring 14.00-16:20)
- MPLS experiment
- 继续卷技术 埋头苦学,越学越会
- Apartment rental system based on JSP
- SSM练习第五天
- Sign up now | cloud native technology exchange meetup Guangzhou station has been opened, and I will meet you on August 6!
猜你喜欢
随机推荐
Visual VM positioning oom, fullgc usage
Continue to work hard on your skills, and the more you learn, the more you will learn
LeetCode50天刷题计划(Day 5—— 最长回文子串 10.50-13:00)
钉钉第三方服务商应用ISV应用开发及上架教程
How to design test cases well
SSM练习第五天
LeetCode_134_加油站
ALV屏幕输入选项学习
Redis核心原理
Day 4 of SSM practice_ Get user name_ User exit_ User CRUD_ Password encryption_ Roles_ jurisdiction
[translation] Why do you need an API gateway to manage access to your API?
[ Kitex 源码解读 ] 服务发现
The first day of Oracle (review and sort out the common knowledge points of development)
OpenGL中的视差贴图的着色器代码
突发!Arm停止与华为合作!对华为影响究竟有多大?
"Wei Lai Cup" 2022 Niuke summer multi school training camp 3 record
Linear regression -- Taking an arithmetic sequence as an example
网上炒股,选择在哪里开户比较安全呢?
链表-合并两个排序的列表
ICML 2022 (Part 4) | | graph hierarchical alignment graph kernel to realize graph matching









