当前位置:网站首页>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 )
边栏推荐
- Shell programming core technology "four"
- Shell 编程核心技术《四》
- 页面元素垂直水平居中、实现已知或者未知宽度的垂直水平居中。
- The 300th weekly match of leetcode (20220703)
- Add namespace declaration
- There are multiple divs in the large div, which are displayed on the same line. After overflow, scroll bars are generated without line breaks
- Master the use of auto analyze in data warehouse
- 牛客小白月赛7 F题
- mysql中explain语句查询sql是否走索引,extra中的几种类型整理汇总
- 生成XML元素
猜你喜欢

mysql中explain语句查询sql是否走索引,extra中的几种类型整理汇总

There are multiple divs in the large div, which are displayed on the same line. After overflow, scroll bars are generated without line breaks

Hough Transform 霍夫变换原理

在线SQL转Excel(xls/xlsx)工具
关于判断点是否位于轮廓内的一点思考

Upgrade the smart switch, how much is the difference between the "zero fire version" and "single fire" wiring methods?

勾股数规律(任意三个数能够满足勾股定理需要满足的条件)

2022CoCa: Contrastive Captioners are Image-Text Fountion Models

Online sql to excel (xls/xlsx) tool

Detailed explanation of the binary processing function threshold() of opencv
随机推荐
双冒号作用运算符以及命名空间详解
【问题】druid报异常sql injection violation, part alway true condition not allow 解决方案
偏移量函数及开窗函数
Allure of pytest visual test report
HDU 6440 2018中国大学生程序设计网络选拔赛
FTP, SFTP file transfer
Go微服务(二)——Protobuf详细入门
How to use async Awati asynchronous task processing instead of backgroundworker?
Hough Transform 霍夫变换原理
Shell 编程核心技术《四》
C#实现定义一套中间SQL可以跨库执行的SQL语句(案例详解)
SSRS筛选器的IN运算(即包含于)用法
欧拉函数
用实际例子详细探究OpenCV的轮廓绘制函数drawContours()
“只跑一趟”,小区装维任务主动推荐探索
Bi skills - permission axis
自由小兵儿
《看完就懂系列》字符串截取方法substr() 、 slice() 和 substring()之间的区别和用法
Is Guoyuan futures a regular platform? Is it safe to open an account in Guoyuan futures?
26. Delete the duplicate item C solution in the ordered array