当前位置:网站首页>思考(八十八):使用 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边栏推荐
- HDU 1114: Piggy-Bank ← The Complete Knapsack Problem
- Error: Not a signal or slot declaration
- (11) Metaclass
- [Storage] Dawning Storage DS800-G35 ISCSI maps each LUN to the server
- Use SuperMap iDesktopX data migration tool to migrate map documents and symbols
- How to sort multiple fields and multiple values in sql statement
- mysql tree structure query problem
- 注意潍坊开具发票一般需要注意
- 链表的简单描述及代码的简单实现
- The Tanabata copywriting you want has been sorted out for you!
猜你喜欢

OpenGL 工作原理

VSCode Change Default Terminal how to modify the Default Terminal VSCode

The design idea of DMicro, the Go microservice development framework

基于左序遍历的数据存储实践

word分栏小记

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

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

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

J9 Digital Currency: What is the creator economy of web3?

毕设-基于SSM房屋租赁管理系统
随机推荐
C student management system Insert the student node at the specified location
毕设-基于SSM房屋租赁管理系统
How Jin Cang database correctness verification platform installation file
OpenGL 工作原理
Chinese characters to Pinyin
The 20th day of the special assault version of the sword offer
Solve connect: The requested address is not valid in its context
Apache DolphinScheduler, a new generation of distributed workflow task scheduling platform in practice - Medium
Physical backup issues caused by soft links
QT MV\MVC结构
龙蜥社区第二届理事大会圆满召开!理事换届选举、4 位特约顾问加入
Go 微服务开发框架 DMicro 的设计思路
2022了你还不会『低代码』?数据科学也能玩转Low-Code啦!
Is your data safe in this hyperconnected world?
Syntax basics (variables, input and output, expressions and sequential statement completion)
Regular expression to match a certain string in the middle
Dynamic management of massive service instances
Lexicon - the maximum depth of a binary tree
A small tool to transfer files using QR code - QFileTrans 1.2.0.1
1873. 计算特殊奖金