1

I want to update the machine type of my Google Cloud SQL instance, but this takes several minutes to update (second generation instance). The instance will be unavailable until the instance has restarted. Because of this downtime, we have to update the machine type at night time, so our visitors are the least troubled by this update.

Is there a workflow how we can minimise this downtime to zero or maybe a few seconds? I already thought about possible solutions like adding a temporary failover or maybe make use of read replica.

kmonsoor
  • 7,600
  • 7
  • 41
  • 55
Roberto Geuke
  • 532
  • 4
  • 14
  • What type of instance is it Cloud SQL? Compute Engine? any other....? – vitooh Mar 26 '20 at 13:25
  • This is Cloud SQL MySQL, isn't it? You are already on 2nd gen or migrating from 1st to 2nd? – vitooh Mar 26 '20 at 13:35
  • This is indeed a Cloud SQL MySQL instance. It's already on 2nd generation, if it was the 1st generation it wouldn't be a problem because changing the machine type would take seconds. – Roberto Geuke Mar 26 '20 at 13:42
  • I though I heard about it, but I have found only this https://cloud.google.com/sql/docs/mysql/upgrade-db. You probably know this, I am not sure if any generic MySQL concepts are possible like https://stackoverflow.com/questions/50076105/mysql-update-whole-database-without-downtime. Anyway good luck! – vitooh Mar 26 '20 at 14:24
  • By using the flow described in https://cloud.google.com/sql/docs/mysql/upgrade-db we will have a write block until we switched to the new instance. This isn't possible because the data (articles and comments) are constantly coming in. Thanks for helping though. – Roberto Geuke Mar 26 '20 at 15:16
  • I don't think there will be avoid this downtime. There are best practice https://cloud.google.com/sql/docs/mysql/best-practices#app where you may find some clues but in general, I think answer seems to be no. Anyway Good Luck in the upgrade ! – vitooh Mar 27 '20 at 13:24

1 Answers1

2

I contacted the support of Google Cloud about this question and they told me that Cloud SQL isn't build to perform this change without downtime. If I want to be able to make these changes, I should look at Cloud Spanner which is a horizontal scalable SQL solution provided by Google.

Roberto Geuke
  • 532
  • 4
  • 14