当前位置:网站首页>Thinking (88): Use protobuf custom options for multi-version management of data
Thinking (88): Use protobuf custom options for multi-version management of data
2022-08-05 03:06:00 【fananchong2】
Data multi-version management
In the production environment of the project, the data is iterated for many times, and the data structure may also be expanded.
There needs to be a way to identify such changes and to do data version upgrades and other requirements
Common ideas, such as: the data in the DB has a version number, and the data structure definition in the code also determines the latest version in some way
Recently seen a more elegant way also available in Etcd
I did the next exercise for reference, and recorded one or two
Entry Multiversion Management for WAL in Etcd
Entry in the WAL file in the Etcd version iteration, resulting in changes to the data structure as the version iterates
Etcd has such a requirement: when the Entry version in its own code is lower than that in the WAL file, it is regarded as an error and the service is closed
Etcd uses protobuf customization options to achieve multi-version definition of Entry
For example:
enum EntryType {option (versionpb.etcd_version_enum) = "3.0";EntryNormal = 0;EntryConfChange = 1; // corresponds to pb.ConfChangeEntryConfChangeV2 = 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边栏推荐
- Data to enhance Mixup principle and code reading
- 【软件测试】自动化测试之unittest框架
- AI+PROTAC | dx/tx completes $5 million seed round
- 从“能用”到“好用” 国产软件自主可控持续推进
- 2022-08-04 第六小组 瞒春 学习笔记
- 龙蜥社区第二届理事大会圆满召开!理事换届选举、4 位特约顾问加入
- How to sort multiple fields and multiple values in sql statement
- 2022-08-04 The sixth group, hidden from spring, study notes
- Compressed storage of special matrices
- (11) Metaclass
猜你喜欢

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

用CH341A烧录外挂Flash (W25Q16JV)

dmp (dump) dump file

Bubble Sort and Quick Sort

2022-08-04 第六小组 瞒春 学习笔记

Why did they choose to fall in love with AI?

.NET应用程序--Helloworld(C#)

2022-08-04 The sixth group, hidden from spring, study notes

告白数字化转型时代,时速云镌刻价值新起点

Use SuperMap iDesktopX data migration tool to migrate ArcGIS data
随机推荐
Matlab drawing 3
IJCAI2022 | DictBert: Pre-trained Language Models with Contrastive Learning for Dictionary Description Knowledge Augmentation
Step by step how to perform data risk assessment
语法基础(变量、输入输出、表达式与顺序语句)
1667. 修复表中的名字
金仓数据库如何验证安装文件平台正确性
The pit of std::string::find return value
虚拟内存原理与技术
QT MV\MVC结构
解决端口占用问题 Port xxxx was already in use
Is your data safe in this hyperconnected world?
21天学习挑战赛(2)图解设备树的使用
开源协议说明LGPL
How OpenGL works
CPDA|How Operators Learn Data Analysis (SQL) from Negative Foundations
Data storage practice based on left-order traversal
How to simulate the background API call scene, very detailed!
程序员的七夕浪漫时刻
QT:神奇QVarient
word分栏小记