当前位置:网站首页>Online data migration scheme encountered in the project 1 - general idea sorting and technical sorting
Online data migration scheme encountered in the project 1 - general idea sorting and technical sorting
2022-07-04 19:35:00 【Koikoi123】
The project has a requirement , Split the old library into the new one , Migrate the old data to the new database , During this period, additional recording and migration of data should be considered , Because no canal Sync , The task I am assigned is to add an interface for adding migration data to the code to ensure smooth migration and data consistency
Because there is a large amount of online data and data will be entered into the table all the time , A few points to consider :
- First, sort out the table of continuous growth data during the wee hours , Tables stored in normal time are generally not written in the wee hours , Or limit it in advance and tell the user not to enter the table during the wee hours , Therefore, it can be ignored not to migrate
- dba transfer 1 All data before clicking , Suppose the migration time is one hour ,2 End of point migration ,2 Double write after clicking , Data in both old and new data sources will be written
- Configure multiple data sources , Realize user-defined annotation to switch data sources
- I will write an open interface , Pass in the specified time range ( If 1 spot -2 spot ), There will be deviation between new and old data sources , I just need to pass in the time range parameter , Interface migration 1-2 Data between points
- This interface does two things , Add and modify , Pull... Separately create_time and update_time All data in this time period , Here must be submitted in advance DB To apply for a work order, index these two fields online
- First check from the old table create_time Range data , Because it is double written , So the entity classes found in the old data source list Need not pass ID Insert new data source ( And insert in pages ) Ensure that the migrated data is consistent , however ID No guarantee ( Because it's self increasing ID There may be problems )
- Check the old table again update_time Range data , also sql much update_time != create_time To ensure that only updated old data is found , When migrating here ID Is to ensure consistency , According to the legend ID updated ( You can use the index here , Currently online log The data volume of the table has ten million levels , But there is not much data in an hour in the morning , Batch update It is not expected to be too slow , The efficiency needs to be verified later )
边栏推荐
- 求2的n次方
- 2014合肥市第三十一届青少年信息学奥林匹克竞赛(小学组)试题
- Stream stream
- Is Guoyuan futures a regular platform? Is it safe to open an account in Guoyuan futures?
- Master the use of auto analyze in data warehouse
- HDU 1372 & POJ 2243 Knight Moves(广度优先搜索)
- 876. Intermediate node of linked list
- 安徽 中安在线文旅频道推出“跟着小编游安徽”系列融媒体产品
- ftp、sftp文件传输
- [release] a tool for testing WebService and database connection - dbtest v1.0
猜你喜欢

使用canal配合rocketmq监听mysql的binlog日志

“只跑一趟”,小区装维任务主动推荐探索

Comment utiliser async awati asynchrone Task Handling au lieu de backgroundworker?

【问题】druid报异常sql injection violation, part alway true condition not allow 解决方案

在线文本行固定长度填充工具
Some thoughts on whether the judgment point is located in the contour

2022CoCa: Contrastive Captioners are Image-Text Fountion Models

"Only one trip", active recommendation and exploration of community installation and maintenance tasks

线上数据库迁移的几种方法

如何使用Async-Awati异步任務處理代替BackgroundWorker?
随机推荐
Shell programming core technology "I"
2021 Hefei informatics competition primary school group
Online text line fixed length fill tool
《看完就懂系列》字符串截取方法substr() 、 slice() 和 substring()之间的区别和用法
Shell programming core technology "four"
Detailed explanation of issues related to SSL certificate renewal
English语法_名词 - 使用
关于判断点是否位于轮廓内的一点思考
【问题】druid报异常sql injection violation, part alway true condition not allow 解决方案
2014合肥市第三十一届青少年信息学奥林匹克竞赛(小学组)试题
Use canal and rocketmq to listen to MySQL binlog logs
MySQL数据库基本操作-DDL | 黑马程序员
《工作、消费主义和新穷人》的微信读书笔记
明明的随机数
勾股数规律(任意三个数能够满足勾股定理需要满足的条件)
prometheus安装
与二值化阈值处理相关的OpenCV函数、方法汇总,便于对比和拿来使用
sqlserver的CDC第一次查询的能读取到数据,但后面增删改读取不到,是什么原因
One question per day (2022-07-02) - Minimum refueling times
YOLOv5s-ShuffleNetV2