当前位置:网站首页>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 )
边栏推荐
- Master the use of auto analyze in data warehouse
- Upgrade the smart switch, how much is the difference between the "zero fire version" and "single fire" wiring methods?
- . Net ORM framework hisql practice - Chapter 2 - using hisql to realize menu management (add, delete, modify and check)
- 2021 Hefei informatics competition primary school group
- 大div中有多个div,这些div在同一行显示,溢出后产生滚动条而不换行
- 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
- 更安全、更智能、更精致,长安Lumin完虐宏光MINI EV?
- 如何使用Async-Awati异步任务处理代替BackgroundWorker?
- Functional interface
- [release] a tool for testing WebService and database connection - dbtest v1.0
猜你喜欢
Detailed explanation of the binary processing function threshold() of opencv
Oracle with as ora-00903: invalid table name multi report error
PolyFit软件介绍
“只跑一趟”,小区装维任务主动推荐探索
自由小兵儿
Explore the contour drawing function drawcontours() of OpenCV in detail with practical examples
2022CoCa: Contrastive Captioners are Image-Text Fountion Models
线上数据库迁移的几种方法
更安全、更智能、更精致,长安Lumin完虐宏光MINI EV?
English语法_名词 - 使用
随机推荐
redis分布式锁的8大坑总结梳理
偏移量函数及开窗函数
FPGA timing constraint sharing 01_ Brief description of the four steps
Build your own website (15)
Lenovo explains in detail the green smart city digital twin platform for the first time to solve the difficulties of urban dual carbon upgrading
Qt实现界面滑动切换效果
LeetCode FizzBuzz C#解答
The latest progress of Intel Integrated Optoelectronics Research promotes the progress of CO packaging optics and optical interconnection technology
2014 Hefei 31st youth informatics Olympic Games (primary school group) test questions
SSL证书续费相关问题详解
Generate XML elements
Add namespace declaration
求2的n次方
One question per day (2022-07-02) - Minimum refueling times
C # implementation defines a set of SQL statements that can be executed across databases in the middle of SQL (detailed explanation of the case)
在线SQL转Excel(xls/xlsx)工具
876. Intermediate node of linked list
Pytest 可视化测试报告之 Allure
English语法_名词 - 使用
QT realizes interface sliding switching effect