Is last_modified_time safe?

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.