当前位置:网站首页>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边栏推荐
- 2022-08-04: Input: deduplicated array arr, the numbers in it only contain 0~9.limit, a number.Return: The maximum number that can be spelled out with arr if the requirement is smaller than limit.from
- 1667. 修复表中的名字
- Is your data safe in this hyperconnected world?
- Apache DolphinScheduler, a new generation of distributed workflow task scheduling platform in practice - Medium
- tree table lookup
- [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
- 语法基础(变量、输入输出、表达式与顺序语句完成情况)
- Ant Sword Advanced Module Development
- Multithreading (2)
- 开源协议说明LGPL
猜你喜欢

Dynamic management of massive service instances

Countdown to 2 days|Cloud native Meetup Guangzhou Station, waiting for you!

The design idea of DMicro, the Go microservice development framework

CPDA|How Operators Learn Data Analysis (SQL) from Negative Foundations

The Tanabata copywriting you want has been sorted out for you!

VSCode Change Default Terminal how to modify the Default Terminal VSCode

沃谈小知识 |“远程透传”那点事儿

word column notes

Why did they choose to fall in love with AI?

The usage of try...catch and finally in js
随机推荐
程序员的七夕浪漫时刻
沃谈小知识 |“远程透传”那点事儿
private package
ASP.NET application--Hello World
Tencent Cloud [Hiflow] New Era Automation Tool
How to sort multiple fields and multiple values in sql statement
QT MV\MVC structure
torch.roll()
Chinese characters to Pinyin
Beyond YOLO5-Face | YOLO-FaceV2 officially open source Trick+ academic point full
QT language file production
mysql tree structure query problem
Syntax basics (variables, input and output, expressions and sequential statement completion)
The design idea of DMicro, the Go microservice development framework
引领数字医学高地,中山医院探索打造未来医院“新范式”
Cloud Native (32) | Introduction to Platform Storage System in Kubernetes
Bubble Sort and Quick Sort
QStyle platform style
2022-08-04 第六小组 瞒春 学习笔记
Talking about data security governance and privacy computing