Tuesday, October 17, 2017

[google-cloud-sql-discuss] Re: How to perform schema changes on replica?

The way we handle this (and we did this with self-hosted MariaDB, before we migrated some databases to Cloud SQL), is to create a copy of the table we wish to modify with the new schema, perform the alter there, and use triggers to keep the old and new tables in sync. When the alters are complete and tables are in async, we use RENAME TABLE, which is atomic, to swap the two tables. This means we can make big alters without incurring downtime.

We're mostly a PHP shop, so we use a project called LHM to handle all of this orchestration for us: https://github.com/masom/lhm_php.

On Monday, October 16, 2017 at 1:21:48 PM UTC-4, Roman Semenov wrote:
> You need to modify the master; this is what the managed environment allows

So I need to put my website down for maintenance for a full day or more just to change DB schema? And there are no alternatives? This sounds strange especially considering that on Amazon I can perform those changes without any downtime in a way described above.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/2c1bea4d-2f96-44d6-8271-a1a573e9f131%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment