Cloud SQL has three backup options, and they exist because they solve three different problems. Automatic backups are the daily safety net. Manual backups are the on-demand snapshot. Scheduled exports are the long-term archive. The Associate Cloud Engineer exam expects you to know which one fits which scenario, and there is one specific distinction between backups and exports that the exam likes to test. This article covers all of it.
It does not cover restore commands in detail, every retention configuration, or how backups interact with replication. The goal is the working knowledge the Associate Cloud Engineer exam tests.
Automatic backups run on a schedule that Cloud SQL manages. You configure a 4-hour window during which the daily backup will happen, and Cloud SQL takes it. By default, automatic backups are retained for up to 7 days, and older ones roll off as new ones come in.
This is the right default for most production databases. You get a full backup every day, with no manual effort, and a week of recovery options. For most operational use cases, that is enough.
The catch is the 7 day retention. If you need to recover a state from two weeks ago, automatic backups will not have it. For longer retention, you need to combine automatic backups with one of the other two options, usually scheduled exports.
Manual backups are exactly what they sound like. You trigger a backup whenever you want, and Cloud SQL takes it. They can be retained as long as you keep them. There is no automatic deletion.
The most common use case is a snapshot before a risky operation. About to run a schema migration. About to update a major library version. About to do anything that you might want to undo. A manual backup before the change gives you a clean rollback point.
Manual backups are useful but they are not a strategy by themselves. They depend on someone remembering to take them. For a real backup posture, automatic backups handle the routine and manual backups handle the special cases.
Scheduled exports are a different beast. They are not Cloud SQL backups. They are exports of the database to Cloud Storage, on a schedule you configure. Cloud SQL writes a SQL dump file, or a CSV, to a bucket you specify, on the schedule you set.
This is the long-term archive option. Once the dump file is in Cloud Storage, you can apply lifecycle rules, transition to Coldline or Archive storage classes, retain for years if you need to. Compliance requirements that say "keep all database backups for 7 years" are usually satisfied with scheduled exports to a bucket with appropriate lifecycle and retention policies.
This is the distinction the Associate Cloud Engineer exam tests most often.
Automatic backups and manual backups are managed Cloud SQL backups. They are stored inside Cloud SQL's own backup system, not in a bucket you control. They restore quickly and integrate cleanly with Cloud SQL features like PITR. But they are tied to Cloud SQL. You cannot easily move them somewhere else, and they are subject to Cloud SQL's retention model.
Exports are SQL dump files in Cloud Storage. They are portable. You can copy them, share them, restore them to a different Cloud SQL instance, or even import them into a non-Cloud-SQL database. They are the right answer when you need long-term retention, portability, or compliance archival. They are slower to restore from than managed backups.
If a question mentions long-term retention, archival, compliance, or portability, the answer involves exports. If a question mentions fast recovery, daily safety, or the standard backup posture, the answer involves automatic or manual backups.
"A team wants to ensure their database is automatically backed up daily." Automatic backups, configured during the daily backup window.
"Before a major migration, the team wants a snapshot they can roll back to." Manual backup, taken before the migration starts.
"The compliance team requires database backups to be retained for 5 years." Scheduled exports to Cloud Storage. Automatic backups will not work because of the 7 day default retention. Even with extended retention, exports to a bucket with lifecycle rules are the cleaner answer.
"The team needs to restore an instance to the state from 3 days ago." Automatic backups can do this, since 3 days is within the default 7 day window.
"The team needs to restore to a state from 6 months ago." Scheduled exports, restored from the dump file in Cloud Storage.
gcloud sql backups create --instance=my-instance \
--description="Pre-migration snapshot"
The description field is useful. Cloud SQL keeps it as metadata, and you can find the right backup later by description rather than just by timestamp.
Three backup options, three jobs. Automatic for daily safety. Manual for on-demand snapshots before risky operations. Scheduled exports to Cloud Storage for long-term archival and portability. The Associate Cloud Engineer exam tests the distinction between managed backups and exports more than any other detail in this topic, so be ready to recognize when a scenario calls for one versus the other.
My Associate Cloud Engineer course covers Cloud SQL backups together with PITR, replication, and the rest of the Cloud SQL operational topics the Associate Cloud Engineer exam tests.