All guides
Practice now
D2 · Exploring data with Google Cloud

Storage and databases in Google Cloud

A complete guide to choosing the right storage service: Cloud Storage, Cloud SQL, , , Spanner, and more.

The complete storage map

Golden rule for the CDL: first ask yourself what type of data? (objects, relational, NoSQL, analytical) and then at what scale? (small/medium vs petabytes).

ServiceTypeScaleBest for
ObjectsUnlimitedFiles, images, backups, data lakes, static content
Relational SQLTBOLTP web apps with MySQL, PostgreSQL, or SQL Server
Cloud SpannerDistributed global SQLPetabytesGlobal-scale SQL with strong consistency and 99.999% availability
AlloyDBPostgreSQL compatibleTBEnterprise OLTP + OLAP workloads on PostgreSQL with 4x performance and a built-in columnar engine
FirestoreNoSQL documentTBMobile/web apps with real-time data and sync
BigtableNoSQL columnarPetabytesTime series, IoT, AdTech at massive scale with sub-10ms latency
MemorystoreIn-memory cacheGB-TBManaged Redis/Memcached for session and query caching
Analytical data warehousePetabytesHistorical data analysis, reporting, ML with SQL

Cloud Storage in depth

The 4 storage classes

Class

Standard

SLA

Access

Unlimited with no extra charge

Typical use

Active data: app images, websites, frequently accessed data

Class

Nearline

SLA

99.95%

Access

Min 30 days, charged per access

Typical use

Monthly backups, data accessed ~once a month

Class

Coldline

SLA

99.95%

Access

Min 90 days, charged per access

Typical use

Quarterly archiving, rarely accessed DR data

Class

Archive

SLA

99.95%

Access

Min 365 days, charged per access

Typical use

Long-term archiving: audit, compliance, historical data

Exam traps about Cloud Storage

  • Durability (99.999999999%) ≠ availability. Availability varies by class (Standard=99.99%, others=99.95%).
  • Object Lifecycle Management moves objects between classes automatically — no downtime and no URL change.
  • Cloud Storage ≠ a file system. It is OBJECT storage. For NFS-style shared files use Filestore.
  • Multi-region (us, eu, asia) has higher availability than regional but is more expensive and data is distributed geographically.

Databases: detailed comparison

Cloud SQL vs Cloud Spanner

DimensionCloud SQLCloud Spanner
TechnologyStandard MySQL, PostgreSQL, SQL ServerGoogle's proprietary engine with a SQL API
ScaleVertical scaling (up to 96 vCPU, 624 GB RAM)Unlimited horizontal scaling (automatic splits)
AvailabilityHigh availability: 99.95% with regional HA99.999% multi-regional (5 nines)
ConsistencyStrong within a zone/regionStrong globally with TrueTime
Write latencyLow (milliseconds)Higher (~5-20ms) due to global synchronization
CostFrom $15/monthFrom $65/month per node
Best forStandard web/mobile apps, CMS, e-commerceGlobal apps: banking, gaming, real-time inventory

Firestore vs Bigtable

DimensionFirestoreBigtable
ModelNested JSON documents with collectionsWide table: rows + columns (sparse)
ScaleTB (automatic)Petabytes (horizontal)
LatencyMilliseconds (real-time queries)Sub-10ms for reads/writes
QueriesComplex queries with composite indexesOnly by row key and range scans (no SQL)
RT syncYes — real-time listeners for clientsNo — batch/streaming processing
Best forMobile/web apps with end users, profiles, configsIoT (millions of devices), time series, AdTech

The value of data: conceptual foundations

Database

A structured store of an application's operational data. Optimized for reading/writing individual records in real time. E.g.: Cloud SQL, Firestore, Bigtable.

Data Warehouse

A store of structured historical data for analysis. Optimized for analytical queries over large volumes. Data is loaded from multiple sources. E.g.: BigQuery.

Data Lake

A repository that stores data in its raw form (structured and unstructured) with no prior processing. Maximum flexibility. E.g.: Cloud Storage as a data lake.

Data typeDescriptionExamples
Structured dataOrganized in tables with rows and columns. Fixed, predefined schema.Orders, customers, bank transactions, inventory.
Semi-structured dataHas structure but flexible. No rigid schema. Formats: JSON, XML, CSV.Application logs, API data, configurations.
Unstructured dataNo schema. The vast majority of data in the world (80%+).Images, videos, PDF documents, audio, emails, code.

AlloyDB — high-performance PostgreSQL

AlloyDB for PostgreSQL is Google Cloud's high-performance relational database, compatible with PostgreSQL but built on its own distributed architecture. It combines OLTP (transactional) with OLAP analytical capabilities — eliminating the need to maintain separate databases for each workload.

For the CDL exam: AlloyDB appears when the scenario mentions PostgreSQL that needs more performance than Cloud SQL can offer, or when mixed OLTP+OLAP workloads are required.

Key features

4x faster than standard PostgreSQL

A distributed storage architecture that separates compute from storage — similar to Aurora on AWS.

100% PostgreSQL compatible

Migration from Cloud SQL (PostgreSQL) or on-premises PostgreSQL with no application code changes.

OLTP + OLAP in a single DB

Built-in columnar engine for analytical queries without affecting transactional performance. You don't need BigQuery for real-time analytics over operational data.

Built-in AI

AlloyDB AI: native vector and vector search directly in PostgreSQL. Ideal for apps and semantic search.

AlloyDB vs Cloud SQL vs

AspectCloud SQLAlloyDBCloud Spanner
EngineMySQL / PG / SQL ServerPostgreSQL enhancedGoogle's own SQL
ScaleTB (vertical)TB (distributed)Petabytes (global)
Built-in OLAPNoYesNo
GlobalNoNo (regional)Yes (multi-region)
PriceLowMedium-HighHigh

Exam rule

If the scenario says "PostgreSQL" + "high performance" or "real-time analytics on operational data" → AlloyDB. If it only says "PostgreSQL" with no extreme requirements → Cloud SQL.

Data Governance

Data governance is the set of policies, processes, and tools to ensure data is accessible, secure, high-quality, and used ethically and in compliance with regulations.

Data quality

Accurate, complete, consistent, and up-to-date data. Low-quality data leads to incorrect decisions.

Data catalog

An inventory of what data exists, where it is, what it means, and who can access it. Dataplex on GCP.

Data lineage

Tracing the origin and transformations of a piece of data from its source to the final report. Key for audits.

Privacy and compliance

Complying with GDPR, LGPD, HIPAA: classifying sensitive data, controlling access, anonymizing when appropriate.

Dataplex: data governance on GCP

Dataplex is Google Cloud's service for intelligent data management at scale. It lets you organize data distributed across Cloud Storage and BigQuery into logical "lakes," apply centralized security policies, automatically catalog metadata, and monitor data quality with rules.

Did you get this topic?

Test what you just learned

A startup is building a mobile messaging app with millions of users that needs to sync messages in real time across devices and scale automatically. Which Google Cloud database is most suitable?

Ready to test "Storage and databases in Google Cloud"?

Put what you learned to the test with original CDL exam questions.

Start CDL mock exam

Unlimited mock exams with the Pro plan

Log in to track your progress.