Seamless Migration from MySQL to PostgreSQL with Zero Downtime Using Blue/Green Deployment

    Migration that empowers our growth without disrupting production

    At times, you simply outgrow your old database system, like you can outgrow a pair of old jeans – it has served you well for many years, but now it is simply holding you back. Our client was using an 8 yr old MySQL table with 120 million records as the foundation of their application. They needed to migrate to PostgreSQL for scalable growth and were not allowed to experience downtime since their customers relied on that table 24 hours a day. How do you pull off a migration of this scale and not have anyone miss a beat? Spoiler alert...you do not simply turn off the lights and cross your fingers!


    Challenges

    • Scale of data migration: Migrating 120 million records is a serious undertaking – especially from a legacy MySQL table.
    • Production downtime: As the entire application had significant reliance on this table, production downtime was not tolerated.
    • Organizational continuity: It was equally important that the business continued to operate during the migration.

    The Solution

    Knackforge set up an Amazon Aurora PostgreSQL cluster with a partitioned table approach based on the year of the record as the partition key.

    • To facilitate a faster migration and not completely saturate the application’s network bandwidth, we used eight AWS Data Migration Service (DMS) tasks to filter records by year.

    • Due to the parallel approach, we were able to continuously deliver incoming data into PostgreSQL.
    • We leveraged AWS CodeDeploy blue/green deployment for the cutover: once all the partitions synced, we flipped the traffic to the new database without any downtime at all.
    • The old environment sat in parallel as a guarantee to fall back on until we verified everything was running seamlessly—as if we changed planes in mid air without spilling our coffee.

    The Impact

    With Knackforge Cloud Services in place, the customer experienced:

    • Seamless migration: 120 million records moved uninterrupted from MySQL into PostgreSQL, giving zero disruption to end users.
    • Zero downtime: The application was fully available to everyone during the migration—customers were completely unaware that a migration took place.
    • Future-proofed growth: The new Aurora PostgreSQL setup allows for scalability and performance and will permit the application to scale without hitting another roadblock.

    Technologies Used:

    • AWS DMS
    • Amazon Aurora PostgreSQL
    • AWS CodeDeploy blue/green deployment