每次上线都要加字段,走变更,如何破局?
架构师修行之路
共 1935字,需浏览 4分钟
·
2022-01-01 23:55
预留扩展字段
CREATE TABLE `t_order` (
`id` bigint(11) NOT NULL AUTO_INCREMENT,
`orderNo` varchar(64) DEFAULT NULL,
`buyerId` bigint(11) DEFAULT NULL,
`storeId` bigint(11) DEFAULT NULL,
`addition1` varchar(64) DEFAULT NULL COMMENT '扩展字段',
`addition2` varchar(64) DEFAULT NULL COMMENT '扩展字段',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
存储Json字符串
addition={"sku":{name:"xxx",id:111},"addr":{"name":"xxx","city":"xxx"}}
通用KV服务
set(key, value)
batchSet(List
) get(key)
list(key1, key2,keyn)
key=订单号+sku
value={name:"xxx",id:111}
key=订单号+addr
value={"name":"xxx","city":"xxx"}
老人新坑:新项目别一上来就用微服务!!
原来这才是 Socket!
一致性哈希和分库分表有毛关系?
评论