Skip to content

Chapter 4 of 11

Databases: Cloud SQL, Firestore, and Bigtable

Select relational, document, or wide-column managed databases from access patterns.

44 minutes 10 quick checksBy Subha Prasad
Lesson 4 of 11Course navigation

Lesson content

Read, practise, then check your understanding

Databases: Cloud SQL, Firestore, and Bigtable

Cloud SQL manages supported relational engines. Firestore is a serverless document database with application SDKs and realtime capabilities. Bigtable is a distributed wide-column database for very large, low-latency operational and analytical workloads.

Core ideas

  • Cloud SQL high availability uses a regional setup for failover across zones.
  • Firestore organizes documents in collections and indexes queries; document paths and query patterns shape design.
  • Bigtable row keys control ordering and distribution, so monotonically increasing prefixes can create hotspots.
  • No one database is universally best; consistency, transactions, query shape, scale, latency, and operations drive selection.

Design and operating model

Write the access patterns and transaction boundaries before selecting a product. Use Cloud SQL for relational constraints and familiar SQL. Use Firestore for document-centric mobile, web, or server applications. Use Bigtable for huge sparse datasets with key-range access. Test realistic data size and skew.

Example

gcloud sql instances create training-sql \
  --database-version=POSTGRES_17 \
  --region=asia-south1 \
  --availability-type=REGIONAL \
  --cpu=2 \
  --memory=7680MiB

gcloud firestore databases list
gcloud bigtable instances list

Run examples in a disposable training project. Replace project IDs, Regions, identities, resource names, sizes, and policies with reviewed values, and verify current Google Cloud CLI and service requirements before production use.

Production guidance

  • Use private connectivity and IAM or database authentication appropriate to the engine.
  • Enable automated backups and point-in-time capabilities, then rehearse restore into isolation.
  • Monitor query latency, connections, replication, capacity, index growth, and hot partitions.

The chapter quiz follows the lesson and checks both service vocabulary and architecture decisions.

Knowledge check

Answer every question correctly to complete this chapter.

Which statement correctly describes Cloud SQL?
Which term matches this explanation: A managed relational database service for supported SQL engines.
Which statement correctly describes Firestore?
Which term matches this explanation: A serverless document database with realtime and mobile/web SDK capabilities.
Which statement correctly describes Bigtable?
Which term matches this explanation: A wide-column NoSQL database for very large low-latency analytical or operational workloads.
Which statement correctly describes high availability configuration?
Which term matches this explanation: A regional database arrangement designed for failover across zones.
Which statement correctly describes database selection?
Which term matches this explanation: Choosing a service from access model, consistency, scale, latency, and operational requirements.

0 of 10 checks passed

Your progress is saved on this device.