当前位置:网站首页>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 )
边栏推荐
- Specify the character set to output
- 1003 Emergency(25 分)(PAT甲级)
- Bi skills - permission axis
- Build your own website (15)
- Shell 编程核心技术《四》
- Guys, for help, I use MySQL CDC 2.2.1 (Flink 1.14.5) to write Kafka and set
- 欧拉函数
- 牛客小白月赛7 F题
- The CDC of sqlserver can read the data for the first time, but it can't read the data after adding, deleting and modifying. What's the reason
- BI技巧丨权限轴
猜你喜欢
牛客小白月赛7 谁是神箭手
Detailed explanation of the binary processing function threshold() of opencv
Summary and sorting of 8 pits of redis distributed lock
"Only one trip", active recommendation and exploration of community installation and maintenance tasks
Pytorch学习(四)
Build your own website (15)
Hough Transform 霍夫变换原理
更安全、更智能、更精致,长安Lumin完虐宏光MINI EV?
mysql中explain语句查询sql是否走索引,extra中的几种类型整理汇总
一文掌握数仓中auto analyze的使用
随机推荐
Pytorch学习(四)
反射(一)
用实际例子详细探究OpenCV的轮廓绘制函数drawContours()
Shell 编程核心技术《三》
LeetCode第300场周赛(20220703)
Go微服务(二)——Protobuf详细入门
1003 Emergency(25 分)(PAT甲级)
双冒号作用运算符以及命名空间详解
C#实现定义一套中间SQL可以跨库执行的SQL语句(案例详解)
The 300th weekly match of leetcode (20220703)
Online sql to excel (xls/xlsx) tool
Opencv functions and methods related to binary threshold processing are summarized for comparison and use
2022CoCa: Contrastive Captioners are Image-Text Fountion Models
升级智能开关,“零火版”、“单火”接线方式差异有多大?
876. Intermediate node of linked list
Hough Transform 霍夫变换原理
有关架构设计的个人思考(本文后续不断修改更新)
Is it safe to open an account at Great Wall Securities? How to open an account when buying stocks
2021 Hefei informatics competition primary school group
大div中有多个div,这些div在同一行显示,溢出后产生滚动条而不换行