QuestionQ111

Managing implementation

You are migrating an application that uses MySQL from on-premises to Google Cloud. The application will run on Compute Engine and use Cloud SQL. You want to cut over to the Compute Engine deployment with minimal downtime and without customer data loss. You also want to migrate the application with minimal modifications and determine the cutover strategy.

What should you do?

  • A
    1. Set up Cloud VPN to provide private network connectivity between the Compute Engine application and the on-premises MySQL server. 2. Stop the on-premises application. 3. Create a mysqldump of the on-premises MySQL server. 4. Upload the dump to a Cloud Storage bucket. 5. Import the dump into Cloud SQL. 6. Modify the source code of the application to write queries to both databases and read from its local database. 7. Start the Compute Engine application. 8. Stop the on-premises application.
  • B
    1. Set up Cloud SQL proxy and MySQL proxy. 2. Create a mysqldump of the on-premises MySQL server. 3. Upload the dump to a Cloud Storage bucket. 4. Import the dump into Cloud SQL. 5. Stop the on-premises application. 6. Start the Compute Engine application.
  • C
    1. Set up Cloud VPN to provide private network connectivity between the Compute Engine application and the on-premises MySQL server. 2. Stop the on-premises application. 3. Start the Compute Engine application, configured to read and write to the on-premises MySQL server. 4. Create the replication configuration in Cloud SQL. 5. Configure the source database server to accept connections from the Cloud SQL replica. 6. Finalize the Cloud SQL replica configuration. 7. When replication has been completed, stop the Compute Engine application. 8. Promote the Cloud SQL replica to a standalone instance. 9. Restart the Compute Engine application, configured to read and write to the Cloud SQL standalone instance.
  • D
    1. Stop the on-premises application. 2. Create a mysqldump of the on-premises MySQL server. 3. Upload the dump to a Cloud Storage bucket. 4. Import the dump into Cloud SQL. 5. Start the application on Compute Engine.
Explanation

Cloud SQL replication from an external MySQL server is designed to migrate self-managed MySQL data to Google Cloud with minimal downtime. Keeping the Compute Engine application connected to the on-premises database while Cloud SQL replicates preserves normal writes; after replication catches up, stopping the application, promoting the Cloud SQL replica to a standalone primary, and repointing the application provides a short, controlled cutover without data loss.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!