当前位置:网站首页>思考(八十八):使用 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边栏推荐
猜你喜欢

How to sort multiple fields and multiple values in sql statement

Step by step how to perform data risk assessment

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

Why did they choose to fall in love with AI?

Ant Sword Advanced Module Development

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

lua学习

How Jin Cang database correctness verification platform installation file

Flink 1.15.1 Cluster Construction (StandaloneSession)

【 genius_platform software platform development 】 : seventy-six vs the preprocessor definitions written cow force!!!!!!!!!!(in the other groups conding personnel told so cow force configuration to can
随机推荐
数学-求和符号的性质
2022-08-04:输入:去重数组arr,里面的数只包含0~9。limit,一个数字。 返回:要求比limit小的情况下,能够用arr拼出来的最大数字。 来自字节。
注意潍坊开具发票一般需要注意
Intersection of Boolean Operations in SuperMap iDesktop.Net - Repairing Complex Models with Topological Errors
mysql can't Execute, please solve it
A small tool to transfer files using QR code - QFileTrans 1.2.0.1
CPDA|How Operators Learn Data Analysis (SQL) from Negative Foundations
post-study program
PostgreSQL数据库 用navicat 打开表结构的时候报错 cannot update secondarysnapshot during a parallel operation 怎么解决?
毕设-基于SSM房屋租赁管理系统
Syntax basics (variables, input and output, expressions and sequential statement completion)
The usage of try...catch and finally in js
Principle and Technology of Virtual Memory
dmp (dump) dump file
Programmer's Tanabata Romantic Moment
The 22-07-31 weeks summary
Why did they choose to fall in love with AI?
Cybersecurity and the Metaverse: Identifying Weak Links
通过模拟Vite一起深入其工作原理
Linux下常见的开源数据库,你知道几个?