当前位置:网站首页>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 )
边栏推荐
- The latest progress of Intel Integrated Optoelectronics Research promotes the progress of CO packaging optics and optical interconnection technology
- 数组中的第K个最大元素
- Add namespace declaration
- An example of multi module collaboration based on NCF
- Bi skills - permission axis
- 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
- Nebula importer data import practice
- .NET ORM框架HiSql实战-第二章-使用Hisql实现菜单管理(增删改查)
- 大div中有多个div,这些div在同一行显示,溢出后产生滚动条而不换行
- 关于判断点是否位于轮廓内的一点思考
猜你喜欢

Don't just learn Oracle and MySQL!

Upgrade the smart switch, how much is the difference between the "zero fire version" and "single fire" wiring methods?
关于判断点是否位于轮廓内的一点思考

Lm10 cosine wave homeopathic grid strategy

PolyFit软件介绍

整理混乱的头文件,我用include what you use

如何使用Async-Awati异步任务处理代替BackgroundWorker?

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

2022CoCa: Contrastive Captioners are Image-Text Fountion Models

自由小兵儿
随机推荐
Is it safe to open an account at Great Wall Securities? How to open an account when buying stocks
node_exporter部署
FPGA时序约束分享01_四大步骤简述
Some thoughts on whether the judgment point is located in the contour
Shell 编程核心技术《二》
升级智能开关,“零火版”、“单火”接线方式差异有多大?
反射(一)
偏移量函数及开窗函数
1003 Emergency(25 分)(PAT甲级)
YOLOv5s-ShuffleNetV2
Use canal and rocketmq to listen to MySQL binlog logs
HDU 1097 A hard puzzle
关于判断点是否位于轮廓内的一点思考
牛客小白月赛7 I 新建 Microsoft Office Word 文档
Shell programming core technology II
876. 链表的中间结点
Shell 編程核心技術《四》
Online text line fixed length fill tool
读写关闭的channel是啥后果?
Lenovo explains in detail the green smart city digital twin platform for the first time to solve the difficulties of urban dual carbon upgrading