Attention. The article was written in 2015. Please read updates below or check on your own.

Google Cloud SQL is a fully managed MySQL service as part of the Google Cloud GCE. Managed databases have a number of advantages. For me it could mean fewer worries about backups, configuration, scaling and updates of that critical system part. Operations around Stateful Systems like Databases cab keep you busy still ins the cloud age, when not managed. In that sense Google’s Cloud SQL looks very promising, so I tried a very small instance which cost approx 10$ a month. And I tried it as a replacement for my own (not tuned) MySQL instance running in a docker container on a g1-small (1 vCPU, 1,7 GB RAM) instance backed by 40 GB SSD (not local SSD). And test result have disappointed me a little.

Prices

First let’s take a look on Google Cloud instance prices:

Resource Charge per hour
D0 Database Instance (0.125GB RAM) $0.025
D2 Database Instance (1GB RAM) $0.19
D4 Database Instance (2GB RAM) $0.29
D8 Database Instance (4GB RAM) $0.58
D16 Database Instance (8GB RAM) $1.16
D32 Database Instance (16GB RAM) $2.31
Resource Charge
1GB Storage $0.24 per month
I/O $0.10 per Million

The Test

I’ve tested with a D0 which is indeed an entry-level instance. But however, my own instance running on g1-small  gives me results of selects within 0,01- 0,04 seconds on index search on a table with approx 200k entries… The same query needs 1,1-0.9! seconds on D0 instance of Google SQL Cloud. What? Why so slow? :(

My Cloud SQL instance are living in “Compute engine Zone” and in the european zone where my another instances are located…

Currently I’m paying about 30$ for my g1-small instance and it runs not only MySQL but also a web workers as well… and MySQL performance stays impressively high. More 0,01 vs. 1 means 100 times less latency… Of course test are very raw and calibrated too, but what to tweak here on them if the latency is 100 times worse?

My expectation would be that google

  • Lowers network latency between GCE and MySQL Cluster
  • Runs that instances on SSDs (seem not be the case). Better on attached SSDs.
  • Provides more benchmarks and comparisons

What is your experience? How do you run your relational databases in the (Google) Cloud?

UPDATE 2017: Cloud SQL second generation

As reminded in the comment, meanwhile (Since 2016?) there is a second generation of Google Cloud SQL, that is much much faster and flexible! Also Cloud SQL instances can be placed near to your GCE Virtual machines. That reduces network latency. With that Google has improved and Cloud SQL becomes very competitive! In my new tests I saw a minimum of difference yet. Due to a fact that packages still need to travel over network some queries need 0,01 seconds longer in average on a very similar setup. How ever, this is much close to what i would expect as to be normal or good.

With that, Cloud SQL in the second generation becomes very interesting and I will very likely switch to it with my projects soon.