Online MySQl incremental ETL because the source table does NOT have last_modified_timetimestamp not null default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP), it is more difficult to add up online ddl although there are tools, however, these tables are core tables and exceed 300 GB). Therefore, a trigger is enabled in the slave database to record the PK and the corresponding modified_time; this has several drawbacks:
1. If the DML of the master database generates the row format binlog, the trigger of the slave database will not be triggered.
2. The TPS of these tables is close to double.
The other method is to add the last_modified_time column in the slave database. However, even if the data is extracted from such a column, is it foolproof? See the following sequence:
Transaction T1: -- start at 23:59:59, insert a row of records at the same time, last_modified_time = 23:59:59
ETL starts extraction at 00:00:00 and records it as transaction T2. At this time, T1 is not submitted and is invisible to T2.
Transaction T1 was submitted at 00:00:01;
This record is lost for ETL. What is the best solution? What I can think of now is the Change Data Capature, which is similar to the CDC in Oracle. MySQL can parse binlog TO DO IT). Welcome to discuss it.
This article is from "MIKE's old blog" blog, please be sure to keep this source http://boylook.blog.51cto.com/7934327/1298802