当前位置:网站首页>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 )
边栏推荐
- 876. Intermediate node of linked list
- To sort out messy header files, I use include what you use
- Hough Transform 霍夫变换原理
- 矩阵翻转(数组模拟)
- 大佬们,求助一下,我用mysql cdc 2.2.1(flink 1.14.5)写入kafka,设置
- ftp、sftp文件传输
- An example of multi module collaboration based on NCF
- 生成XML元素
- 牛客小白月赛7 E Applese的超能力
- 如何使用Async-Awati异步任务处理代替BackgroundWorker?
猜你喜欢
Stream流
Safer, smarter and more refined, Chang'an Lumin Wanmei Hongguang Mini EV?
Wireshark网络抓包
OpenCV的二值化处理函数threshold()详解
SSRS筛选器的IN运算(即包含于)用法
Pointnet/Pointnet++点云数据集处理并训练
PointNeXt:通过改进的模型训练和缩放策略审视PointNet++
勾股数规律(任意三个数能够满足勾股定理需要满足的条件)
One question per day (2022-07-02) - Minimum refueling times
PolyFit软件介绍
随机推荐
《工作、消费主义和新穷人》的微信读书笔记
Oracle with as ORA-00903: invalid table name 多表报错
Master the use of auto analyze in data warehouse
. Net ORM framework hisql practice - Chapter 2 - using hisql to realize menu management (add, delete, modify and check)
Unity editor extends C to traverse all pictures in folders and subdirectories
English语法_名词 - 使用
Detailed explanation of issues related to SSL certificate renewal
Shell 编程核心技术《四》
LeetCode FizzBuzz C#解答
更安全、更智能、更精致,长安Lumin完虐宏光MINI EV?
Nebula importer data import practice
1007 Maximum Subsequence Sum(25 分)(PAT甲级)
In flinksql, in addition to data statistics, is the saved data itself a state
Don't just learn Oracle and MySQL!
Crawler (6) - Web page data parsing (2) | the use of beautifulsoup4 in Crawlers
线上数据库迁移的几种方法
Shell programming core technology "four"
安徽 中安在线文旅频道推出“跟着小编游安徽”系列融媒体产品
FPGA timing constraint sharing 01_ Brief description of the four steps
从实时应用角度谈通信总线仲裁机制和网络流控