当前位置:网站首页>思考(八十八):使用 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边栏推荐
- 1484. Sell Products by Date
- post-study program
- Go 微服务开发框架 DMicro 的设计思路
- QT: The Magical QVarient
- 剑指offer专项突击版第20天
- 通过模拟Vite一起深入其工作原理
- In 2022, you still can't "low code"?Data science can also play with Low-Code!
- Details such as compiling pretreatment
- Matlab drawing 3
- [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
猜你喜欢

How Jin Cang database correctness verification platform installation file

Step by step how to perform data risk assessment

dmp(dump)转储文件

mysql没法Execute 大拿们求解

In 2022, you still can't "low code"?Data science can also play with Low-Code!

Simple description of linked list and simple implementation of code

21天学习挑战赛(2)图解设备树的使用

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

Matlab画图3

Multithreading (2)
随机推荐
Tencent Cloud [Hiflow] New Era Automation Tool
1667. 修复表中的名字
QT MV\MVC structure
How to sort multiple fields and multiple values in sql statement
Native js realizes the effect of selecting and canceling all the multi-select boxes
Regular expression to match a certain string in the middle
语法基础(变量、输入输出、表达式与顺序语句)
Syntax basics (variables, input and output, expressions and sequential statements)
The usage of try...catch and finally in js
Images using redis cache Linux master-slave synchronization server hard drive full of moved to the new directory which points to be modified
Semi-Decentralized Federated Learning for Cooperative D2D Local Model Aggregation
程序员的七夕浪漫时刻
C student management system Insert the student node at the specified location
倒计时 2 天|云原生 Meetup 广州站,等你来!
沃谈小知识 |“远程透传”那点事儿
The linear table lookup
Matlab drawing 3
金仓数据库如何验证安装文件平台正确性
剑指Offer--找出数组中重复的数字(三种解法)
Cybersecurity and the Metaverse: Identifying Weak Links