当前位置:网站首页>思考(八十八):使用 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边栏推荐
- The 20th day of the special assault version of the sword offer
- 1484. 按日期分组销售产品
- Talking about data security governance and privacy computing
- Industry case | insurance companies of the world's top 500 construction standards can be used to drive the business analysis system
- The linear table lookup
- private package
- Summary of domestic environments supported by SuperMap
- mysql没法Execute 大拿们求解
- 程序员的七夕浪漫时刻
- Everyone in China said data, you need to focus on core characteristic is what?
猜你喜欢

Question about #sql shell#, how to solve it?

Ant Sword Advanced Module Development

云原生(三十二) | Kubernetes篇之平台存储系统介绍

Talking about data security governance and privacy computing

Use SuperMap iDesktopX data migration tool to migrate ArcGIS data
![[C language] Detailed explanation of stacks and queues (define, destroy, and data operations)](/img/7b/8b3f1e4f0000aa34fc1f8fff485765.png)
[C language] Detailed explanation of stacks and queues (define, destroy, and data operations)

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

View handler 踩坑记录

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

Use SuperMap iDesktopX data migration tool to migrate map documents and symbols
随机推荐
云原生(三十二) | Kubernetes篇之平台存储系统介绍
链表的简单描述及代码的简单实现
Note that Weifang generally needs to pay attention to issuing invoices
dmp (dump) dump file
Hash table lookup (hash table)
22-07-31周总结
Error: Not a signal or slot declaration
【软件测试】自动化测试之unittest框架
Physical backup issues caused by soft links
dmp(dump)转储文件
剑指Offer--找出数组中重复的数字(三种解法)
Beidou no. 3 short message terminal high slope in open-pit mine monitoring programme
通过模拟Vite一起深入其工作原理
Syntax basics (variables, input and output, expressions and sequential statements)
汉字转拼音
开源协议说明LGPL
Step by step how to perform data risk assessment
Everyone in China said data, you need to focus on core characteristic is what?
A small tool to transfer files using QR code - QFileTrans 1.2.0.1
QStyle platform style