SaveMyCert
Log in
5 of 5 free questions left today·for 10 a day
Ensuring the successful operation of a cloud solution

Managing Cloud Storage and Databases: Lifecycle, Backups, and CMEK

18 min readACE · Ensuring the successful operation of a cloud solutionUpdated

Managing storage and data solutions on Google Cloud is the day-2 operation of Cloud Storage buckets and managed databases: securing and recovering objects, automating their storage class and deletion, querying each data service with its native tool, backing up and restoring databases, checking job status, estimating storage cost, watching the database fleet, and controlling encryption keys. Four skills carry most of the weight: securing Cloud Storage objects (uniform bucket-level access with IAM, signed URLs and signed policy documents for outsiders, versioning and soft delete for recovery), writing object lifecycle rules that transition or delete objects by age and version state, protecting databases with the right backup mechanism (Cloud SQL backups and point-in-time recovery, and the equivalents in Spanner, Firestore, AlloyDB and Bigtable), and configuring customer-managed encryption keys (CMEK) in Cloud KMS. This lesson covers each task the way it is used in practice: pick the mechanism, know the command, and understand the cost, recovery and security consequences.

What you’ll learn
  • Secure Cloud Storage objects with uniform bucket-level access and IAM, and explain how fine-grained ACLs, public access prevention and the UBLA organization policy interact
  • Give outsiders temporary access with signed URLs or signed policy documents, and recover deleted or overwritten objects with versioning, soft delete, retention policies and holds
  • Write object lifecycle rules that transition objects across storage classes and delete noncurrent versions with numNewerVersions, daysSinceNoncurrentTime and isLive
  • Query each managed data service with its native tool: gcloud sql connect or the Auth Proxy, bq, cbt or GoogleSQL for Bigtable, gcloud spanner, and the Firestore and AlloyDB clients
  • Configure backups and point-in-time recovery for Cloud SQL, Spanner, Firestore, AlloyDB and Bigtable, and know where each restore lands
  • Estimate storage cost across Cloud Storage classes and BigQuery storage and compute, and review Dataflow and BigQuery job status
  • Use Database Center for fleet-wide database health, and configure CMEK with Cloud KMS, including the service agent grant and the effects of rotating, disabling or destroying key versions

Securing objects in Cloud Storage: uniform access, IAM, and ACLs

You secure Cloud Storage objects with IAM, and on almost every bucket you should enable uniform bucket-level access (UBLA), which disables object and bucket ACLs so IAM policies alone govern access. That gives one consistent, auditable permission model. The legacy alternative, fine-grained access, lets each object carry its own ACL alongside IAM; it is needed only for rare per-object permission schemes and is a common source of accidental exposure. Grant access with roles such as roles/storage.objectViewer (read objects), roles/storage.objectCreator (upload only), roles/storage.objectAdmin (full object control) and roles/storage.admin (buckets and objects), for example gcloud storage buckets add-iam-policy-binding gs://BUCKET_NAME --member=user:ana@example.com --role=roles/storage.objectViewer. The gcloud storage command group replaces the older gsutil workflows.

What changes when you switch a bucket to uniform access

  • ACL requests fail. While UBLA is on, any request that reads or sets an ACL (including uploads that pass a predefined ACL) is rejected with HTTP 400. Applications that set ACLs must be changed to rely on IAM.
  • Access granted only through ACLs disappears. Anyone who could read an object only because of its ACL loses access; grant them an IAM role on the bucket (or use IAM Conditions) instead.
  • There is a 90-day window back. You can disable UBLA only within 90 days of enabling it. Cloud Storage keeps the old ACLs and restores them if you switch back in time; objects uploaded while UBLA was on receive the bucket's default object ACL. After 90 days the change is permanent.
  • The organization policy affects new buckets only. The storage.uniformBucketLevelAccess constraint forces UBLA on buckets created after it is set; it does not convert existing buckets, which you must update individually (gcloud storage buckets update gs://BUCKET_NAME --uniform-bucket-level-access). While the constraint is enforced, buckets that already have UBLA also cannot disable it, so the 90-day window only helps where the constraint does not apply.

Public access prevention is a separate control: it blocks any grant to allUsers or allAuthenticatedUsers, through IAM or ACLs, but it does not disable ACLs and does not replace UBLA. Use both when a bucket must never be public and must be governed by IAM only.

Temporary access for outsiders: signed URLs and signed policy documents

To give someone without a Google identity or IAM grant temporary access, sign the request with a service account's credentials instead of changing the bucket policy. Two mechanisms exist, and the difference is what the holder may do.

Signed URLSigned policy document
GrantsOne HTTP method (for example GET or PUT) on one named objectAn HTML form POST upload into the bucket
Restrictions you can setExpiry time; the object name and method are fixed in the signatureExpiry plus conditions such as content-length-range (size limits), Content-Type, and object-name prefix
Typical useA partner downloads a report, or an app uploads one file with PUTCustomers upload files from a plain browser form with size and type limits

A V4 signed URL is valid for at most 7 days, for example gcloud storage sign-url gs://BUCKET_NAME/report.pdf --duration=1h --private-key-file=key.json (or sign through the IAM Credentials API to avoid downloading a key). A signature only delegates access the signer already has: the signing service account must itself be allowed to read (or write) the object, otherwise the URL returns an access error. Neither mechanism needs the bucket to be public, and making a bucket public to share one file is never the right fix.

Recovering objects: versioning, soft delete, retention policies and holds

Cloud Storage has three features that keep data around after a delete or overwrite, and they solve different problems: versioning keeps old generations indefinitely, soft delete keeps deleted data for a fixed window, and retention policies and holds stop the change from happening at all.

FeatureWhat it doesHow long data is keptHow you recover
Object versioningAn overwrite or delete turns the live object into a noncurrent versionUntil a lifecycle rule or a user deletes the version — no built-in expiryList with gcloud storage ls --all-versions and copy the generation back
Soft deleteRetains deleted and overwritten objects (and deleted buckets) for a window7 days by default; configurable from 7 to 90 days, or 0 to disableRestore with gcloud storage restore within the window
Retention policy / object holdsPrevents deleting or replacing objects until a retention period ends or a hold is releasedAs long as the policy or hold applies; a locked retention policy cannot be shortened or removedNothing to recover — the change is refused

Soft delete is on by default for new buckets, so even a bucket without versioning can recover an accidental delete for a week. It bills the retained data at the object's storage class rate for the retention window. Versioning plus lifecycle rules suits keeping a set number of earlier copies; soft delete suits a safety net against mistakes; a retention policy (or event-based/temporary holds) suits compliance rules that must stop even administrators from deleting data.

Object lifecycle management policies

A lifecycle policy automates cost control: each rule pairs one action with one or more conditions, and Cloud Storage applies the action when every condition in the rule is true. The main actions are SetStorageClass (move the object to a colder class only: Standard to Nearline, Coldline or Archive; Nearline to Coldline or Archive; Coldline to Archive) and Delete (remove the object, or a noncurrent version); AbortIncompleteMultipartUpload cleans up abandoned uploads.

ConditionMatches whenTypical use
ageN days have passed since the object (or version) was createdMove logs to Nearline after 30 days, delete after 365
createdBeforeObject was created before a dateOne-time cleanup of legacy data
isLivetrue targets the live version; false targets noncurrent versionsLimit a rule to noncurrent versions in a versioned bucket
numNewerVersionsAt least N versions newer than this one exist, counting the live versionKeep only a fixed number of earlier versions
daysSinceNoncurrentTimeN days have passed since the version became noncurrentDelete replaced versions 30 days after replacement
matchesStorageClassObject is in one of the listed classesTransition only Standard objects, skip ones already cold

Counting versions and days correctly

  • numNewerVersions includes the live version. To keep the live object plus K noncurrent versions, delete when numNewerVersions is K + 1. With N = 1 every noncurrent version is deleted as soon as it exists, because the live version is already newer.
  • age counts from creation, not from replacement. A rule of isLive: false plus age: 14 deletes an old version the moment it is replaced, because it was created long ago. To keep each replaced version for 14 days after it was replaced, use daysSinceNoncurrentTime: 14.

Policies are JSON applied to the bucket: gcloud storage buckets update gs://BUCKET_NAME --lifecycle-file=lifecycle.json. A typical policy for versioned log data moves objects to Nearline at 30 days, Coldline at 90 and Archive at 365, and deletes noncurrent versions with numNewerVersions: 5 (live plus four earlier copies). Changes can take up to 24 hours to take effect.

Storage class costs that lifecycle rules trigger

Nearline, Coldline and Archive carry minimum storage durations of 30, 90 and 365 days and charge retrieval fees per GiB read. The minimum duration is measured from the object's original creation time, including time spent in an earlier class: an object created 40 days ago and moved to Coldline can be deleted 50 days later without an early-deletion charge. Deleting or replacing it sooner bills the remainder. A rule that pushes frequently read data into Archive therefore raises cost. When access patterns are unknown or shift, enable Autoclass, which moves each object between classes based on its access; an Autoclass bucket cannot also have SetStorageClass lifecycle rules (Delete rules are still allowed).

Executing queries against your data services

Each data service has a native query path, and you choose by data model and service. The table summarizes the tools; the notes below cover the behaviour that trips people up.

ServiceData modelQuery tools
Cloud SQLRelational (MySQL, PostgreSQL, SQL Server)gcloud sql connect, Cloud SQL Auth Proxy plus a normal client, Cloud SQL Studio
AlloyDBPostgreSQL-compatiblepsql and other PostgreSQL clients (usually via the AlloyDB Auth Proxy), AlloyDB Studio
BigQueryAnalytical warehouseBigQuery Studio, bq query, client libraries
SpannerRelational, globally distributedgcloud spanner databases execute-sql, Spanner Studio, client libraries
BigtableWide-column NoSQLcbt CLI, client libraries, GoogleSQL via Bigtable Studio and client libraries
FirestoreDocumentClient libraries and the console query builder over collections and documents

Cloud SQL and AlloyDB

gcloud sql connect INSTANCE_NAME --user=postgres allowlists your current IP address on the instance for a short time (about five minutes) and opens the engine's shell, which makes it convenient for ad hoc queries from Cloud Shell but not for permanent connections. For applications, the Cloud SQL Auth Proxy opens IAM-authorized, encrypted connections without authorized networks or a fixed client IP. Its prerequisites are the Cloud SQL Admin API enabled in the project and an identity holding roles/cloudsql.client (Cloud SQL Client). Without the proxy, a public-IP connection needs the client's address in authorized networks; client SSL certificates encrypt and authenticate the connection but do not replace that allowlist. AlloyDB follows the same pattern with its own Auth Proxy and standard PostgreSQL clients.

BigQuery with bq

The bq query command uses legacy SQL by default unless a default dialect is configured (in .bigqueryrc, or with the project or organization default_sql_dialect_option setting). Pass --use_legacy_sql=false (or --nouse_legacy_sql) to run GoogleSQL: bq query --use_legacy_sql=false 'SELECT name, COUNT(*) FROM dataset.table GROUP BY name'. Results print in the terminal. Adding --dry_run validates the query and reports the bytes it would process without running it, returning no rows and incurring no query charge.

Spanner, Bigtable and Firestore

For Spanner, gcloud spanner databases execute-sql DATABASE_NAME --instance=INSTANCE_NAME --sql='SELECT SingerId, FirstName FROM Singers WHERE LastName = "Rivera"' runs SQL from Cloud Shell and prints the result. Bigtable is a wide-column store addressed by row key. The cbt CLI covers everyday reads: cbt lookup TABLE ROW_KEY fetches one row, cbt read TABLE prefix=PREFIX (or start=/end=) scans a range, cbt count TABLE counts rows, and cbt ls TABLE lists a table's column families. Bigtable also supports GoogleSQL queries through Bigtable Studio and the client libraries, and you can still query it from BigQuery with an external table. Firestore is queried as documents in collections through client libraries or the console, not with table SQL.

Estimating the cost of data storage

You estimate storage cost from three factors — volume stored, storage class or tier, and access pattern — and the Google Cloud Pricing Calculator turns planned usage into a number before any resource exists. For Cloud Storage the estimate is GiB-months stored per class, plus operation charges, plus retrieval fees for cold classes, plus network egress, plus early-deletion charges where objects leave before their minimum duration. Archive is the cheapest at rest but expensive to read, so the right class depends on how often data is accessed, not just how much there is.

BigQuery separates storage from compute. Storage is billed for data at rest, and any table or partition that is not modified for 90 consecutive days automatically moves to long-term storage at about half the active rate. Querying a table does not reset that timer; loading, updating or streaming data into it does. Long-term pricing applies under both the logical and the physical (compressed) storage billing models, and there is no performance difference. Compute is either on-demand, billed per TiB scanned by each query, or capacity-based, billed for reserved slots. On-demand is why partitioning, clustering and dry runs matter: a query pruned to one partition scans and bills a fraction of the table.

Cloud SQL and AlloyDB bill for provisioned vCPUs, memory and storage over time plus backup storage, so their estimates look like VM sizing; Spanner bills compute capacity plus storage and backups; Bigtable bills nodes plus storage. After launch, use actual-spend tools instead of estimates: billing reports break spend down by service and SKU, budgets alert on thresholds, and exporting billing data to BigQuery lets you query it. Use the Pricing Calculator for planned designs and billing reports, budgets or the billing export for what you are actually spending.

Backing up and restoring database instances

Each managed database has its own backup mechanism, and the main question is whether it restores to a backup's state or to an exact moment, and whether the restore overwrites something or creates a new resource.

Cloud SQL

Enable automated backups (daily, in a window you choose) with gcloud sql instances patch INSTANCE_NAME --backup-start-time=03:00, and take on-demand backups with gcloud sql backups create --instance=INSTANCE_NAME. Restoring a backup overwrites the target instance's data. The target may be the original instance or a different one: gcloud sql backups restore BACKUP_ID --restore-instance=TARGET_INSTANCE --backup-instance=SOURCE_INSTANCE overwrites TARGET_INSTANCE with a backup taken from SOURCE_INSTANCE and leaves the source untouched. Point-in-time recovery (PITR) requires automated backups plus transaction log retention (binary logging on MySQL, write-ahead log archiving on PostgreSQL), and always creates a new instance at the chosen timestamp: gcloud sql instances clone prod-db prod-db-recovered --point-in-time='2026-10-05T10:39:00Z'. Read replicas and the high-availability standby are not recovery tools: they mirror the primary's current data, including an accidental DELETE or corruption.

Spanner, Firestore, AlloyDB and Bigtable

ServiceBackupsPoint-in-time recoveryRestore target
SpannerManaged backups (on demand or by backup schedule) kept up to 1 year; import/export via Dataflow for portable copiesThe version_retention_period (default 1 hour, up to 7 days) allows stale reads and a backup created with a past version_time inside that windowAlways a new database
FirestoreBackup schedules: at most one daily (kept up to 7 days) and one weekly (kept up to 14 weeks); managed export to Cloud Storage for portable copiesPITR keeps versions for the past 7 days when enabledBackup restore always creates a new database; an export is imported into a database
AlloyDBContinuous backup and recovery (on by default) plus automated and on-demand backupsContinuous backup window defaults to 14 days, configurable from 1 to 35 daysA new cluster at the chosen timestamp
BigtableTable-level backups (standard or hot), copyable to other instances or projectsNo general PITR; restore a backupA new table in the same or another instance

Commands worth recognising: gcloud spanner backups create BACKUP --instance=INSTANCE --database=DATABASE --retention-period=30d (add --version-time to capture an earlier moment), gcloud firestore backups schedules create --database='(default)' --recurrence=weekly --day-of-week=SUN --retention=10w, and gcloud firestore databases restore --source-backup=BACKUP_NAME --destination-database=NEW_DB. Managed backups differ from exports: a Firestore export to Cloud Storage or a Spanner export via Dataflow is portable data for migration or long-term archive, while native backups are faster to restore but live inside the service.

Reviewing job status: Dataflow and BigQuery

You check Dataflow job status on the console's Dataflow Jobs page, where each job shows its state (Running, Succeeded, Failed, Cancelled, Drained), the pipeline graph, per-step metrics, autoscaling history and worker logs. From the CLI, gcloud dataflow jobs list --region=REGION lists jobs and gcloud dataflow jobs describe JOB_ID --region=REGION shows one job. To stop a streaming job, drain finishes processing in-flight data then stops, while cancel stops immediately and may drop buffered records. Diagnose failures from the step-level logs and error counters.

In BigQuery, every query, load, export and copy runs as a job. The console's personal and project Job history shows status, duration and bytes processed. From the CLI, bq ls -j --max_results=20 lists recent jobs (-a includes all users' jobs if you have permission) and bq show -j JOB_ID prints one job's status and error detail. For analysis across many jobs, query the INFORMATION_SCHEMA job views with SQL. They are region-qualified, not dataset-qualified, and you query the region where the jobs ran, for example `region-europe-west2`.INFORMATION_SCHEMA.JOBS.

ViewScopePermission needed
JOBS (alias JOBS_BY_PROJECT)All users' jobs in the current projectbigquery.jobs.listAll on the project (for example the BigQuery Resource Viewer or Admin role)
JOBS_BY_USEROnly the caller's own jobsbigquery.jobs.list
JOBS_BY_FOLDER / JOBS_BY_ORGANIZATIONJobs in every project under a folder or the organizationbigquery.jobs.listAll granted at folder or organization level

The views expose columns such as user_email, query, state, error_result and creation_time, so ordinary SQL filters and aggregates answer most job-history questions. Operationally, connect job monitoring to alerting: Dataflow metrics flow into Cloud Monitoring for alerting policies on failures or system lag, and BigQuery job errors appear in Cloud Logging where log-based alerts apply.

Managing the database fleet with Database Center

Database Center is a single console view of your whole database fleet — Cloud SQL, AlloyDB, Spanner, Bigtable, Firestore, Memorystore and more — across projects, so you stop checking instance pages one by one. It inventories every database resource and adds health signals: availability risks such as instances without high availability or automated backups, security findings such as broad network exposure, performance issues, and cost recommendations, largely from Active Assist recommenders. It also offers a Gemini-powered chat for natural-language questions about the fleet.

The workflow is triage: review the fleet summary of issues by category and severity, drill into an affected resource, and act on the recommendation. Position it against its neighbours: Database Center is fleet-wide inventory, health and recommendations; Cloud Monitoring is metrics, dashboards and alerting for any resource; Query Insights (Cloud SQL and AlloyDB) finds which queries consume CPU or run slowly inside one instance; Cloud Asset Inventory lists and searches resources and their metadata of every type, without database health analysis. Finding every database missing backups is a fleet question; diagnosing slow or expensive queries inside one instance is Query Insights work.

Configuring customer-managed encryption keys (CMEK)

All data in Google Cloud is encrypted at rest by default with Google-managed keys; CMEK changes who controls the key, not whether encryption happens. With CMEK, data is protected by a key you create and manage in Cloud KMS: you control rotation, you can disable or destroy it, and its use is audited. Any protection level works — software, HSM (Cloud HSM) or external (Cloud EKM) — as long as the service supports it. Customer-supplied encryption keys (CSEK), where you send raw key material with each request, are a rarer, heavier alternative available for Cloud Storage and Compute Engine.

Setup has three steps and one critical grant. First, create a key ring and key: gcloud kms keyrings create my-ring --location=us-central1, then gcloud kms keys create my-key --keyring=my-ring --location=us-central1 --purpose=encryption. The key can live in a different project from the data (a central key project is common), but its location must be compatible with the resource it protects. Second, grant the data service's service agent roles/cloudkms.cryptoKeyEncrypterDecrypter on the key. Each service has its own per-project agent, for example service-PROJECT_NUMBER@gs-project-accounts.iam.gserviceaccount.com for Cloud Storage and bq-PROJECT_NUMBER@bigquery-encryption.iam.gserviceaccount.com for BigQuery; the grant goes to the agent of the project that owns the data. Third, attach the key: set a bucket's default key with gcloud storage buckets update gs://BUCKET_NAME --default-encryption-key=KEY_RESOURCE_NAME, or pass the key when creating a Cloud SQL instance, BigQuery dataset or Spanner database. For many services, CMEK can only be chosen at creation.

Key changeEffect on protected data
Rotate (new primary version)New data is encrypted with the new version; existing data is not re-encrypted and still needs the older versions
Disable a versionData encrypted with that version becomes unreadable until it is re-enabled; disabling an old version after rotation breaks reads of older objects
Destroy a versionThe version is scheduled for destruction (30 days by default) and can be restored only during that period; after that, data encrypted with it is permanently lost
Revoke the service agent's roleThe service can no longer encrypt or decrypt with the key; reads and writes fail

So keep old key versions enabled for as long as data encrypted with them exists. When storage "suddenly became inaccessible" after a security cleanup, the usual cause is a disabled or destroyed key version or a removed service agent grant.

Tip. Expect scenario questions on securing Cloud Storage (uniform bucket-level access and what breaks when you enable it, signed URLs versus signed policy documents for outside users) and on recovering objects with versioning, soft delete or retention policies. Lifecycle questions turn on precise conditions: numNewerVersions counting the live version, age versus daysSinceNoncurrentTime, minimum storage durations counted from creation, and retrieval fees. Query questions match the tool to the service (gcloud sql connect or the Auth Proxy, bq with GoogleSQL and dry runs, cbt, gcloud spanner execute-sql). Backup questions compare Cloud SQL backup restores (which overwrite the target) with point-in-time recovery (a new instance), and test Spanner, Firestore, AlloyDB and Bigtable backup windows and restore targets. Also expect cost estimation (Pricing Calculator, BigQuery long-term storage), job status (bq show -j, INFORMATION_SCHEMA.JOBS by region, gcloud dataflow jobs), Database Center versus Query Insights, and CMEK service agent grants and key-version effects.

Key takeaways
  • Uniform bucket-level access makes IAM the only permission model: ACL requests then fail with 400, it can be reverted only within 90 days, and the org policy constraint applies only to new buckets.
  • Signed URLs give one method on one object for up to 7 days (V4); signed policy documents allow browser form uploads with size and content-type conditions. Either way the signer must already have access.
  • Versioning keeps noncurrent versions until deleted; soft delete keeps deleted or overwritten data for 7 to 90 days (default 7); retention policies and holds block the change instead.
  • numNewerVersions counts the live version (keep live + K earlier copies with N = K + 1); age counts from creation, daysSinceNoncurrentTime from replacement.
  • Minimum storage durations count from original creation time; Autoclass cannot be combined with SetStorageClass rules.
  • bq query defaults to legacy SQL unless configured, so pass --use_legacy_sql=false for GoogleSQL; --dry_run reports bytes without running the query.
  • Cloud SQL backup restores overwrite the target instance (which can be another instance); PITR needs automated backups plus transaction logs and always creates a new instance; replicas are not backups.
  • Spanner backups last up to 1 year and restore to a new database; Firestore weekly schedules keep up to 14 weeks; AlloyDB continuous backup covers 1 to 35 days (default 14).
  • BigQuery tables or partitions unmodified for 90 days drop to long-term storage pricing automatically; queries do not reset the timer.
  • INFORMATION_SCHEMA job views are region-qualified: JOBS for every user in the project, JOBS_BY_USER for your own jobs.
  • CMEK needs the service agent's cryptoKeyEncrypterDecrypter grant; rotation does not re-encrypt old data, so disabling an old version breaks reads of data encrypted with it.
  • Match the tool to the scope: Database Center for fleet-wide database health and recommendations, Query Insights for slow queries inside one Cloud SQL or AlloyDB instance; drain a Dataflow job to finish in-flight data, cancel it to stop immediately.

Frequently asked questions

When should I use a signed URL instead of an IAM binding in Cloud Storage?

Use a signed URL when someone without a Google identity or IAM grant, such as a partner, a customer's browser or a mobile app, needs temporary access to one specific object. The URL is signed with a service account's credentials, allows one HTTP method on that object, and expires after the duration you set (at most 7 days for V4). The signing service account must itself have access to the object. Use IAM bindings for ongoing access by identities you manage, and use a signed policy document when browser form uploads need size or content-type limits.

What is the difference between object versioning, soft delete and a retention policy in Cloud Storage?

Object versioning keeps each overwritten or deleted object as a noncurrent version with no built-in expiry, so you usually pair it with lifecycle rules. Soft delete keeps deleted and overwritten objects for a fixed window, 7 days by default and configurable from 7 to 90 days (0 disables it), and lets you restore them within that window. A retention policy or object hold prevents deletion or replacement in the first place, which is what compliance rules usually require.

How do I keep only the last few versions of each object with a lifecycle rule?

Add a Delete rule with the numNewerVersions condition. The count includes the live version, so to keep the live object plus K earlier versions, set numNewerVersions to K + 1; for example 5 keeps the live version and four noncurrent ones. To keep each replaced version for a number of days after it was replaced, use daysSinceNoncurrentTime instead of age, because age counts from when the version was created.

How does point-in-time recovery work in Cloud SQL?

Point-in-time recovery combines automated backups with retained transaction logs (binary logs on MySQL, write-ahead logs on PostgreSQL). You run gcloud sql instances clone with --point-in-time, and Cloud SQL builds a new instance at that exact moment; it never rewinds the original in place. It must be enabled before the incident. A normal backup restore, by contrast, overwrites the target instance with the backup's state.

Why does bq query reject my GoogleSQL query?

The bq command-line tool runs queries in legacy SQL unless a default dialect has been configured in .bigqueryrc or through the default_sql_dialect_option setting. Add --use_legacy_sql=false (or --nouse_legacy_sql) to run GoogleSQL. Adding --dry_run validates the query and reports the bytes it would process without running it or returning rows.

How are Spanner, Firestore and AlloyDB backups restored?

Spanner restores a backup into a new database, and a backup can be kept for up to one year or captured at a past version time inside the database's version retention period. Firestore restores a backup into a new database; its daily schedules keep backups up to 7 days and weekly schedules up to 14 weeks, and PITR covers the past 7 days. AlloyDB's continuous backup, on by default with a 14-day window configurable from 1 to 35 days, restores to a new cluster at the chosen time.

What breaks if I disable or destroy a CMEK key version?

Data encrypted with that key version can no longer be decrypted, so objects become unreadable and CMEK-protected databases can fail. Key rotation does not re-encrypt existing data, so older versions must stay enabled while data encrypted with them exists. Disabling is reversible by re-enabling the version. Destroying schedules the version for destruction, 30 days by default, and it can be restored only during that period; afterwards the data is permanently lost. Revoking the service agent's cryptoKeyEncrypterDecrypter role has the same effect as losing the key.

What does Database Center do that Cloud Monitoring and Query Insights do not?

Database Center inventories every Cloud SQL, AlloyDB, Spanner, Bigtable, Firestore and other database resource across projects and flags availability, security, performance and cost issues, such as instances without automated backups or high availability, with recommendations. Cloud Monitoring charts metrics and sends alerts for any resource but does not assess fleet-wide database posture. Query Insights works inside a single Cloud SQL or AlloyDB instance to show which queries consume CPU or run slowly.

Source

This lesson covers the "Ensuring the successful operation of a cloud solution" domain of the official ACE exam guide. Vendors revise their guides — check the source for the current version.

Sign up free to mark lessons complete, bookmark topics and track your exam readiness.

Spotted a mistake in this lesson?