当前位置:网站首页>思考(八十八):使用 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边栏推荐
- 2022了你还不会『低代码』?数据科学也能玩转Low-Code啦!
- Likou - preorder traversal, inorder traversal, postorder traversal of binary tree
- Semi-Decentralized Federated Learning for Cooperative D2D Local Model Aggregation
- 采用redis缓存的linux主从同步服务器图片硬盘满了移到新目录要修改哪些指向
- Industry case | insurance companies of the world's top 500 construction standards can be used to drive the business analysis system
- 金仓数据库如何验证安装文件平台正确性
- 基于左序遍历的数据存储实践
- private封装
- [In-depth study of 4G/5G/6G topic-51]: URLLC-16-"3GPP URLLC related protocols, specifications, and technical principles in-depth interpretation"-11-High reliability technology-2-Link adaptive enhancem
- 龙蜥社区第二届理事大会圆满召开!理事换届选举、4 位特约顾问加入
猜你喜欢

How Jin Cang database correctness verification platform installation file

Compressed storage of special matrices

How OpenGL works

Apache DolphinScheduler, a new generation of distributed workflow task scheduling platform in practice - Medium

Data to enhance Mixup principle and code reading

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

QT MV\MVC结构

VSCode Change Default Terminal 如何修改vscode的默认terminal

北斗三号短报文终端露天矿山高边坡监测方案

基于左序遍历的数据存储实践
随机推荐
语法基础(变量、输入输出、表达式与顺序语句完成情况)
QT语言文件制作
View handler 踩坑记录
Use @Mapper to query the partition status of oracle and report an error
Object.defineProperty monitors data changes in real time and updates the page
腾讯云【Hiflow】新时代自动化工具
解决connect: The requested address is not valid in its context
基于左序遍历的数据存储实践
Open Source License Description LGPL
2022了你还不会『低代码』?数据科学也能玩转Low-Code啦!
甘特图来啦,项目管理神器,模板直接用
lua学习
剑指offer专项突击版第20天
word column notes
解决端口占用问题 Port xxxx was already in use
1484. 按日期分组销售产品
2022-08-04 第六小组 瞒春 学习笔记
数学-求和符号的性质
In 2022, you still can't "low code"?Data science can also play with Low-Code!
C student management system Insert the student node at the specified location