GCP ACE Practice / Study guide / Topics / Choosing a Database on Google Cloud
Choosing a Database on Google Cloud
What actually gets tested on the Google Cloud Associate Cloud Engineer exam,
the traps to know, and 6 free sample questions with full explanations.
This is one of the exam's cleanest decision-framework topics because each database has a genuinely distinct sweet spot. Cloud SQL is managed MySQL/PostgreSQL/SQL Server for conventional relational workloads at single-region scale — read replicas scale reads, but writes stay bound to the primary. Cloud Spanner is the answer whenever a scenario needs both horizontal scale and strong relational consistency across regions at once — that specific combination is Spanner's entire reason to exist, and no other Google Cloud database offers it.
Firestore is the serverless NoSQL document database built for mobile/web apps — client SDKs, live listeners, offline persistence — while Bigtable is the wide-column NoSQL store built for massive throughput and low-latency key-based access, with time-series and IoT data as its flagship use case; it has no client-side sync and is a poor fit for anything mobile-facing. BigQuery rounds this out as the answer for analytics over huge datasets with SQL — it's not meant to be an application's transactional backend at all.
Cloud SQL deserves its own operational detail beyond the choice itself: automated backups and point-in-time recovery are how you protect it day to day, and it supports high-availability configuration (a standby in a different zone) for scenarios that specifically call out failover or uptime requirements — a separate consideration from which database engine to pick in the first place.
Exam tips for this topic
- Spanner is the answer whenever a scenario needs BOTH horizontal scale AND strong relational consistency across regions — that exact combination is unique to it.
- Bigtable is for massive-throughput, low-latency, key-based access (time series, IoT); Firestore is for mobile/web apps that need client sync and offline support. Don't swap them.
- BigQuery is for SQL analytics over large datasets, not as an application's transactional backend — a scenario asking for both should point you elsewhere.
Sample questions — Choosing a Database on Google Cloud
These 6 questions are drawn from our full bank of 658 to show the style and
depth you'll get in the app. Each comes with the full explanation you'd see after answering
in a real practice session.
Cloud SQL
Your team needs a managed PostgreSQL 16 instance for a new internal service. Which command creates it?
- gcloud sql instances create pgmain --database-version=POSTGRES_16 --region=us-central1 --tier=db-custom-2-8192Correct
- gcloud compute instances create --postgres
- gcloud postgres new pgmain
- kubectl create cloudsql
Why: Cloud SQL instances are created via gcloud sql instances create with engine version, region, and machine tier. It's not a Compute Engine instance flag, and kubectl doesn't provision Cloud SQL.
Database choice
You need a relational database with SQL, transactions, and modest scale (hundreds of GB) for a web app, with minimal ops. Which service?
- Cloud SQLCorrect
- Cloud Spanner
- Bigtable
- Memorystore
Why: Cloud SQL is managed MySQL/PostgreSQL/SQL Server for conventional relational workloads at single-region scale. Spanner is for globally distributed, horizontally scalable relational needs (and costs accordingly); Bigtable is NoSQL wide-column; Memorystore is an in-memory cache.
Cloud SQL
Your Cloud Run app must reach its Cloud SQL database securely, without password sprawl or public exposure. What is the recommended way?
- Cloud SQL connectors / built-in Cloud SQL connection (which handle encryption and IAM auth) rather than exposing a public IP with passwordsCorrect
- Public IP with 0.0.0.0/0 authorized
- SSH tunnel through a bastion VM
- Exporting the DB to a bucket nightly
Why: Cloud Run integrates with the Cloud SQL Auth Proxy mechanism natively (--add-cloudsql-instances / connector libraries), giving encrypted, IAM-authorized connectivity. Whitelisting the world is a breach waiting to happen.
Database choice
A global retail platform needs a relational database with strong consistency across regions and effectively unlimited horizontal write scaling. Which service?
- Cloud SpannerCorrect
- Cloud SQL with read replicas
- Firestore
- BigQuery
Why: Spanner uniquely combines relational schema/SQL, strong external consistency, and horizontal scaling across regions. Cloud SQL replicas scale reads only (single write primary); Firestore is a document store; BigQuery is analytics, not OLTP.
Cloud SQL
Which TWO settings should production Cloud SQL instances almost always enable?
- Automated backups (with point-in-time recovery)Correct
- High availability (regional) configurationCorrect
- Public IP open to 0.0.0.0/0
- The smallest shared-core tier
Why: Backups+PITR protect data; HA protects uptime through zone failure. World-open public IP is a security hole, and shared-core tiers are for dev/test.
Database choice
You're ingesting time-series IoT metrics at millions of writes per second with single-digit-millisecond reads by row key. Which database?
- BigtableCorrect
- Cloud SQL
- Firestore
- Cloud Spanner
Why: Bigtable is the wide-column NoSQL store built for massive throughput and low-latency key-based access — time series and IoT are its flagship use cases. Cloud SQL can't reach that write scale; Firestore has per-document write limits; Spanner could work but is relational and costlier for this pattern.
Practice this for real
The app has dozens more questions on this and every other topic, with instant scoring,
spaced repetition of what you get wrong, and progress tracking across sessions.
Start practicing →
This topic shows up in
Other topics