当前位置:网站首页>思考(八十八):使用 protobuf 自定义选项,做数据多版本管理
思考(八十八):使用 protobuf 自定义选项,做数据多版本管理
2022-08-05 03:01:00 【fananchong2】
数据多版本管理
项目在生产环境中,数据经版本多次迭代,数据结构也可能随之扩充
需要有方法,识别这种变化,来做数据版本升级等需求
常见的思路,如:DB 中数据带版本号,代码中数据结构定义也通过某种方式确定最新版本
最近看到 Etcd 中也提供了一种更为优雅的方式
借鉴做了下练习,并记录一二
Etcd 中 WAL 的 Entry 多版本管理
在 Etcd 版本迭代中 WAL 文件中的 Entry ,随着版本迭代,导致数据结构发生变化
Etcd 有这样的需求:自身代码中的 Entry 版本比 WAL 文件中的低时,视为错误,关闭服务
Etcd 使用 protobuf 自定义选项,来达成 Entry 的多版本定义
比如:
enum EntryType {
option (versionpb.etcd_version_enum) = "3.0";
EntryNormal = 0;
EntryConfChange = 1; // corresponds to pb.ConfChange
EntryConfChangeV2 = 2 [(versionpb.etcd_version_enum_value)="3.4"]; // corresponds to pb.ConfChangeV2
}
message Entry {
option (versionpb.etcd_version_msg) = "3.0";
optional uint64 Term = 2 [(gog边栏推荐
- Why did they choose to fall in love with AI?
- 人人都在说的数据中台,你需要关注的核心特点是什么?
- How to solve the error cannot update secondary snapshot during a parallel operation when the PostgreSQL database uses navicat to open the table structure?
- 大像素全景制作完成后,推广方式有哪些?
- The usage of try...catch and finally in js
- leetcode - symmetric binary tree
- 北斗三号短报文终端露天矿山高边坡监测方案
- 沃谈小知识 |“远程透传”那点事儿
- Ant Sword Advanced Module Development
- Native js realizes the effect of selecting and canceling all the multi-select boxes
猜你喜欢

The usage of try...catch and finally in js

shell statement to modify txt file or sh file

Data to enhance Mixup principle and code reading

Ant Sword Advanced Module Development

How Jin Cang database correctness verification platform installation file

大像素全景制作完成后,推广方式有哪些?

Gantt chart is here, project management artifact, template is used directly

mysql没法Execute 大拿们求解

dmp(dump)转储文件

How to sort multiple fields and multiple values in sql statement
随机推荐
1527. 患某种疾病的患者
Lexicon - the maximum depth of a binary tree
word分栏小记
链表的简单描述及代码的简单实现
Review 51 MCU
View handler stepping record
开源协议说明LGPL
C student management system Find student nodes based on student ID
(十一)元类
[深入研究4G/5G/6G专题-51]: URLLC-16-《3GPP URLLC相关协议、规范、技术原理深度解读》-11-高可靠性技术-2-链路自适应增强(根据无线链路状态动态选择高可靠性MCS)
QT语言文件制作
采用redis缓存的linux主从同步服务器图片硬盘满了移到新目录要修改哪些指向
倒计时 2 天|云原生 Meetup 广州站,等你来!
金仓数据库如何验证安装文件平台正确性
Matlab drawing 3
Intersection of Boolean Operations in SuperMap iDesktop.Net - Repairing Complex Models with Topological Errors
2022了你还不会『低代码』?数据科学也能玩转Low-Code啦!
post-study program
Tencent Cloud [Hiflow] New Era Automation Tool
Compressed storage of special matrices