0
votes

This may sound stupid and it is. But i'm wondering if it is possible to create a GCE instance that its sole purpose is to copy data from another GCE's MySQL database and copies all data to a Google Cloud SQL instance every few minutes and essentially updates the GCloud SQL.

Essentially i'm trying to get around how GAE can't connect to a GCE MySQL database but you can connect to a Google cloud SQL database.

I have tried "FEDERATED Tables" however Google Cloud SQL doesn't support that. So this is my last resort.

Thanks

2

2 Answers

0
votes

Why do you need the GCE database at all? That is, why can't you just use a Cloud SQL database for all of your database needs?

0
votes

You could try manually replaying the binary log to your Cloud SQL instance, ie:

  1. Enable binary logging on your GCE MySQL instance.
  2. Use mysqlbinlog to periodically extract the latest contents of the log as SQL statements. Use the positioning functions to make sure each run starts where the last finished.
  3. Send the SQL outputted by mysqlbinlog to your Cloud SQL instance.