GCP offers a rich portfolio of database services covering relational, NoSQL, in-memory, and analytical use cases. Choosing the right database is a core skill tested on the Associate Cloud Engineer and Professional Cloud Architect exams.
Cloud SQL
Cloud SQL is a fully managed relational database service supporting MySQL, PostgreSQL, and SQL Server. Google handles patches, backups, failover, and replication.
Key features:
- Automated backups and point-in-time recovery
- High availability with automatic failover (primary + standby in same region)
- Read replicas for scaling read traffic
- Integrates with Cloud Auth Proxy for secure private connectivity
Best for: Web applications, CMS platforms, microservices that need a traditional relational database. Familiar SQL interface, minimal migration effort.
Cloud Spanner
Cloud Spanner is a globally distributed, horizontally scalable relational database that offers strong consistency at any scale. It combines the SQL familiarity of a relational database with the horizontal scaling of NoSQL.
- Globally distributed with external consistency (linearisability)
- 99.999% SLA for multi-region configurations
- Scales from a single region to a global deployment
Best for: Global financial systems, inventory management, large-scale gaming backends — anywhere you need both strong consistency and global reach. More expensive than Cloud SQL.
Firestore (formerly Datastore)
Firestore is a serverless, NoSQL document database. Data is stored as documents organised into collections. It has two modes:
- Native mode: Real-time listeners, offline support, strong consistency. Best for mobile and web apps.
- Datastore mode: For server-side workloads; backward compatible with the old Cloud Datastore API.
Best for: Mobile apps (Firebase integration), web backends, user profiles, product catalogs — flexible schema, automatic scaling.
Cloud Bigtable
Bigtable is a low-latency, high-throughput wide-column store, designed for very large analytical and operational workloads. It's the same database that powers Google Search, Maps, and Gmail.
- Scales to petabytes with consistent millisecond latency
- HBase API compatible — easy migration
- No SQL support — key/value and column family model
Best for: Time-series data, IoT telemetry, financial market data, AdTech — very high-volume workloads with simple key-based lookups.
BigQuery
BigQuery is GCP's serverless, highly scalable data warehouse. It separates compute from storage and charges per TB of data scanned (or flat rate).
- Analyse petabytes of data with standard SQL
- No servers to provision or manage
- Built-in ML with BigQuery ML (train models using SQL)
- Native connectors to Data Studio, Looker, and Tableau
Best for: Business intelligence, log analytics, marketing analytics, reporting — OLAP workloads, not OLTP.
Memorystore
Memorystore is a fully managed in-memory database service supporting Redis and Memcached. Used for caching, session management, and real-time leaderboards.
Choosing the Right Database
| Need | Service |
|---|---|
| MySQL / PostgreSQL / SQL Server | Cloud SQL |
| Global relational with strong consistency | Cloud Spanner |
| NoSQL documents, mobile/web apps | Firestore |
| High-throughput time-series / wide-column | Bigtable |
| Analytics / data warehouse | BigQuery |
| In-memory caching | Memorystore |