Cloud SQL Flashcards
Cloud SQL definition
Managed database service that provides MySQL, PostgreSQL and SQL Server databases
Key points of CloudSQL (4)
- Allows users to set up database without all the database administration tasks
- High Availability - manages replication and allows for automatic failover
- Suited for applications with consistent data structure (for databases that don’t need to scale horizontally)
- Scales vertically (by running on servers with more memory and CPUs)
What databases and versions does CloudSQL support?
- MySQL 5.6/5.7 up to 416GB RAM and 30TB data storage
- PostgreSQL up to 416GB RAM and 64 CPUs and 30TB storage
- SQL Server 416 GB RAM 64 CPUs 30 TB storage
How do you connect to Cloud SQL via shell?
gcloud sql connect [INSTANCE NAME] -user=[USERNAME]
How do you backup (on demand) Cloud SQL via shell?
gcloud sql backups create –async –instance [INSTANCE NAME]
How do you schedule automatic backup on Cloud SQL via shell?
gcloud sql instances patch [INSTANCE NAME] -backup-start-top [HH:MM]
Where is backup data stored for Cloud SQL?
In a bucket in Cloud Store.
How do you export Cloud SQL data via shell?
gcloud sql export [TYPE] {INSTANCE NAME] gs://[BUCKET]/[FILE NAME] –database=[DATABASE NAME]
You need to make sure that the service account can write to the bucket.
How do you import Cloud SQL data via shell?
gcloud sql import [TYPE] {INSTANCE NAME] gs://[BUCKET]/[FILE NAME] –database=[DATABASE NAME]