r/DatabaseAdministators • • 2d ago

We migrated a 3.7TB MySQL RDS database with zero downtime — and no standard AWS tool could do it alone

The constraints were brutal:
We had a production MySQL monolith at 870+ QPS with no replicas, no maintenance window, and a schema that needed to be fundamentally rebuilt. Every standard approach failed us:

  • AWS Blue/Green → clones the DB, doesn't transform it
  • Online schema tools → too risky on a high-write monolith
  • Bulk delete → locks the table, doesn't free disk without OPTIMIZE TABLE
  • Native DMS → moves data, can't rebuild schema in-flight

So we built our own pipeline.

The interesting part — we used AWS Blue/Green in a way their documentation never mentions. Purely as an infrastructure provisioning tool, then intercepted the entire process to run a custom two-phase DMS pipeline on top.

What we did:

  • Applied new partitioned schema on Green before a single row moved
  • Phase 1: bulk load from snapshot instance (zero read pressure on live DB)
  • Phase 2: CDC from live DB with ID-based filtering to eliminate overlap
  • Shadow table strategy — RENAME TABLE cutover in milliseconds
  • Native MySQL binlog replication to catch the remaining delta
  • Cold data (2.4TB) offloaded to S3 + Athena — completely decoupled from OLTP

Result: 116 tables · ~4 hours · Zero downtime · Zero query loss · 1.75TB storage reclaimed

The database didn't know it had been rebuilt.

Happy to answer any questions on DMS tuning, CDC lag monitoring, or the shadow table approach.

Full write-up with architecture and code here: https://medium.com/towards-aws/beyond-the-standard-switchover-re-architecting-a-3-7tb-mysql-rds-database-zero-downtime-7569be38052f

2 Upvotes

0 comments sorted by