Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloud SQL or VM Instance to host MySQL Database

I have a website and i am confused where to host its database.

Google Cloud SQL D1 tier has 0.5 GB RAM and its cost is $1.46 per day.

GCE n1-standard-2 has 7.5 GB RAM and its cost is 1.68 per day.

I am hosting my current database on Cloud SQL and the performance goes down when concurrent active connections goes up. It must because of low RAM of cloud sql.

I can set up mysql server on VM Instance and can give remote access to external servers. Also, Cloud SQL has limitation on maximum connections.

So, why should i host it on Cloud SQL?

My main concern is performance.

like image 981
Vitul Goyal Avatar asked Dec 01 '15 09:12

Vitul Goyal


1 Answers

Google Cloud SQL is a service that delivers fully managed MySQL databases. Google takes care of applying patches and updates, managing backups, and configuring replication. Installing MySQL on a Compute Engine VM will shift the maintenance and management of MySQL to you.

Every Cloud SQL instance is regionally available (https://cloud.google.com/sql/sla) and includes seven days of free backups. Data is automatically encrypted and replicated in many geographic locations and failover between copies is handled automatically.

Concerning cost, you are not be charged for your Cloud SQL instances when your database is inactive. A database instance is inactive if there are no connections for 15 minutes for "Per Use" billing and 12 hours for "Package" billing. "Per Use" and "Package" billing options help users find savings based on their database usage. Put together, Cloud SQL users with small, infrequently accessed databases often pay less than $1.00 per month, while users running large, frequently accessed databases pay more.

You may be able to outperform Cloud SQL by tuning a MySQL install on GCE specifically for your application, but I recommend factoring in features like automatic failover and backups since these can become management headaches.

like image 131
Brett H. Avatar answered Oct 02 '22 11:10

Brett H.