You are moving an application that uses MySQL from on-premises to Google Cloud.
The application will run on Compute Engine and will use Cloud SQL.
You want to cut over to the Compute Engine deployment of the application with minimal downtime and no data loss to your customers.
You want to migrate the application with minimal modification.
You also need to determine the cutover strategy.
What should you do?
Click on the arrows to vote for the correct answer
A. B. C. D.A.
The correct answer is C.
Option A is incorrect because it involves modifying the application's source code, which the question asks to minimize, and also it requires the application to read from two databases, which increases complexity and potential for errors.
Option B is incorrect because it does not address how to minimize downtime and data loss during cutover.
Option C is the best answer because it involves replicating data from the on-premises MySQL server to Cloud SQL, minimizing downtime, and data loss. Here are the steps in more detail:
Set up Cloud VPN to provide private network connectivity between the Compute Engine application and the on-premises MySQL server.
Stop the on-premises application.
Start the Compute Engine application, configured to read and write to the on-premises MySQL server.
Create the replication configuration in Cloud SQL.
Configure the source database server to accept connections from the Cloud SQL replica.
Finalize the Cloud SQL replica configuration.
When replication has been completed, stop the Compute Engine application.
Promote the Cloud SQL replica to a standalone instance.
Restart the Compute Engine application, configured to read and write to the Cloud SQL standalone instance.
This approach minimizes downtime and data loss because the Compute Engine application can continue to read and write data to the on-premises MySQL server while the data is being replicated to Cloud SQL. Once the replication is complete, the application can be switched over to use the Cloud SQL instance as its primary database, ensuring that there is no data loss.