AWS, Cloud Computing

< 1 min

Amazon RDS Delta Sync Migration for MySQL and PostgreSQL

Voiced by Amazon Polly

Introduction

Database migration is one of the most critical tasks in cloud modernization and infrastructure transformation projects. Production databases continuously process live transactions, customer activities, API requests, inventory updates, and payment records.

Some major migration challenges include:

  • Continuous live data updates
  • Risk of missing transactions
  • Downtime during migration
  • Data inconsistency issues
  • Customer and business impact

To overcome these challenges, organizations use Delta Sync Migration, which synchronizes only changed data continuously until the final cutover window.

This guide explains a real-world AWS cross-account migration approach used to migrate more than 35 MySQL and PostgreSQL databases, including a massive 972GB production database with over 13,840 tables, while keeping downtime to a minimum.

Pioneers in Cloud Consulting & Migration Services

  • Reduced infrastructural costs
  • Accelerated application deployment
Get Started

Overview

This blog covers the complete AWS RDS migration process using a Delta Sync strategy for both MySQL and PostgreSQL databases. It explains:

  • Cross-account AWS RDS migration
  • MySQL and PostgreSQL synchronization
  • Large database migration using parallel processing
  • Recurring sync automation
  • Validation and verification methods
  • Production cutover planning
  • Troubleshooting common migration issues

Why Database Migration is Challenging?

Database migration is not simply copying data from one server to another. Production databases continuously receive new updates and transactions.

For example:

  • Customers continuously place orders
  • Payment systems update records in real time
  • Inventory changes frequently
  • APIs continuously write data

If the database is copied only once, transactions created after the copy will not exist in the destination environment.

This may lead to:

  • Missing orders
  • Incorrect reports
  • Application issues
  • Customer impact

Delta Sync solves this challenge by repeatedly synchronizing only the changed data until the final migration cutover.

Real-World Migration Scenario

In our migration project:

Environment Details

Source Database

Destination Database

Method 1 — MySQL Delta Sync Using mysqldump (Small Databases)

For databases smaller than 10GB, a direct mysqldump | mysql pipe works extremely well.

MySQL Delta Sync Command

Understanding Important Flags

Why –single-transaction Matters

This is one of the most important options during production migrations.

It allows:

  • Live application traffic
  • No table locking
  • Consistent snapshot backup
  • Continuous database usage during migration

This works best with InnoDB tables.

Method 2 Large Database Migration Using mydumper/myloader

For very large databases, traditional mysqldump becomes slow because it runs single-threaded.

We migrated a:

  • 972GB database
  • 13,840+ tables
  • Heavy write production workload

using mydumper and myloader.

Why mydumper?

mydumper provides:

  • Parallel dumping
  • Faster export/import
  • Reduced migration time
  • Better CPU utilization
  • Batch processing

Step 1 — Dump Database from Source

Step 2 — Restore Database to Destination

Expected Warning

This warning is expected on AWS RDS because FLUSH TABLES WITH READ LOCK is restricted.

Performance Results

This was significantly faster than standard mysqldump.

PostgreSQL Delta Sync Migration

For PostgreSQL databases, we used:

  • pg_dump
  • psql
  • Direct pipe method

PostgreSQL Delta Sync Command

Important PostgreSQL Flags

Automating Recurring Delta Sync

To minimize final cutover downtime, we scheduled recurring sync jobs every 5 hours.

Automation Script

Make Script Executable

Configure Cron Job

Database Validation After Sync

Never assume migration succeeded without verification.

Compare Table Counts

Source Database

Destination Database

Example Output

Validate Primary Keys & Constraints

Expected output:

85

Additional Validation Commands

Check Database Size

Validate Row Counts

Validate PostgreSQL Tables

Common Issues & Troubleshooting

  1. Function Restore Error
  1. Password Special Character Issue
  1. InnoDB Table Count Mismatch

information_schema.table_rows is unreliable for InnoDB.

  1. Destination Database Smaller Than Source

This is normal.

Reason:

  • Source DB may contain fragmentation
  • Restore creates optimized tables/pages
  • Unused space gets removed

Conclusion

Database migration is a critical business operation that requires careful planning, validation, and monitoring. Using a Delta Sync strategy, we successfully migrated 35+ MySQL and PostgreSQL databases, including a 972GB production database, with minimal downtime and reliable synchronization.

Drop a query if you have any questions regarding Database migration, and we will get back to you quickly.

Making IT Networks Enterprise-ready – Cloud Management Services

  • Accelerated cloud migration
  • End-to-end view of the cloud environment
Get Started

About CloudThat

CloudThat is an award-winning company and the first in India to offer cloud training and consulting services worldwide. As an AWS Premier Tier Services Partner, AWS Advanced Training Partner, Microsoft Solutions Partner, and Google Cloud Platform Partner, CloudThat has empowered over 1.1 million professionals through 1000+ cloud certifications, winning global recognition for its training excellence, including 20 MCT Trainers in Microsoft’s Global Top 100 and an impressive 14 awards in the last 9 years. CloudThat specializes in Cloud Migration, Data Platforms, DevOps, Security, IoT, and advanced technologies like Gen AI & AI/ML. It has delivered over 750 consulting projects for 850+ organizations in 30+ countries as it continues to empower professionals and enterprises to thrive in the digital-first world.

FAQs

1. Does Delta Sync Lock Production Databases?

ANS: – No. Using: –single-transaction creates a consistent snapshot without locking tables, allowing applications to continue running normally.

2. Why Not Use AWS DMS?

ANS: – For environments with very large schemas, 13,000+ tables, and complex functions, direct dump/restore methods provided better control, easier troubleshooting, and more predictable performance.

WRITTEN BY Shaikh Mohammed Fariyaj Najam

Mohammed Fariyaj Shakh is a Sr. Research Associate – Cloud Engineer at CloudThat with a strong background in AWS and Azure infrastructure management, security, optimization, and automation. Certified in both AWS and Azure, he has hands-on experience in designing, implementing, and managing highly reliable, secure, and scalable cloud solutions. Well-versed in DevOps practices and tools such as Git, GitHub, AWS CI/CD, Jenkins, Docker, Kubernetes, and Terraform, Fariyaj leverages his expertise in automation, Infrastructure as Code (IaC), and container orchestration to build and manage robust deployment pipelines. Known for his strong troubleshooting skills, he delivers effective and scalable solutions to complex cloud challenges.

Share

Comments

    Click to Comment

Get The Most Out Of Us

Our support doesn't end here. We have monthly newsletters, study guides, practice questions, and more to assist you in upgrading your cloud career. Subscribe to get them all!