CDL
Deep Dive
A complete guide to choosing the right storage service: Cloud Storage, Cloud SQL, Firestore, Bigtable, Spanner, and more.
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).
| Service | Type | Scale | Best for |
|---|---|---|---|
| Cloud Storage | Objects | Unlimited | Files, images, backups, data lakes, static content |
| Cloud SQL | Relational SQL | TB | OLTP web apps with MySQL, PostgreSQL, or SQL Server |
| Cloud Spanner | Distributed global SQL | Petabytes | Global-scale SQL with strong consistency and 99.999% availability |
| AlloyDB | PostgreSQL compatible | TB | Enterprise OLTP + OLAP workloads on PostgreSQL with 4x performance and a built-in columnar engine |
| Firestore | NoSQL document | TB | Mobile/web apps with real-time data and sync |
| Bigtable | NoSQL columnar | Petabytes | Time series, IoT, AdTech at massive scale with sub-10ms latency |
| Memorystore | In-memory cache | GB-TB | Managed Redis/Memcached for session and query caching |
| BigQuery | Analytical data warehouse | Petabytes | Historical data analysis, reporting, ML with SQL |
The 4 storage classes
Class
Standard
SLA
99.99%
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
Cloud SQL vs Cloud Spanner
| Dimension | Cloud SQL | Cloud Spanner |
|---|---|---|
| Technology | Standard MySQL, PostgreSQL, SQL Server | Google's proprietary engine with a SQL API |
| Scale | Vertical scaling (up to 96 vCPU, 624 GB RAM) | Unlimited horizontal scaling (automatic splits) |
| Availability | High availability: 99.95% with regional HA | 99.999% multi-regional (5 nines) |
| Consistency | Strong within a zone/region | Strong globally with TrueTime |
| Write latency | Low (milliseconds) | Higher (~5-20ms) due to global synchronization |
| Cost | From $15/month | From $65/month per node |
| Best for | Standard web/mobile apps, CMS, e-commerce | Global apps: banking, gaming, real-time inventory |
Firestore vs Bigtable
| Dimension | Firestore | Bigtable |
|---|---|---|
| Model | Nested JSON documents with collections | Wide table: rows + columns (sparse) |
| Scale | TB (automatic) | Petabytes (horizontal) |
| Latency | Milliseconds (real-time queries) | Sub-10ms for reads/writes |
| Queries | Complex queries with composite indexes | Only by row key and range scans (no SQL) |
| RT sync | Yes — real-time listeners for clients | No — batch/streaming processing |
| Best for | Mobile/web apps with end users, profiles, configs | IoT (millions of devices), time series, AdTech |
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 type | Description | Examples |
|---|---|---|
| Structured data | Organized in tables with rows and columns. Fixed, predefined schema. | Orders, customers, bank transactions, inventory. |
| Semi-structured data | Has structure but flexible. No rigid schema. Formats: JSON, XML, CSV. | Application logs, API data, configurations. |
| Unstructured data | No schema. The vast majority of data in the world (80%+). | Images, videos, PDF documents, audio, emails, code. |
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 embeddings and vector search directly in PostgreSQL. Ideal for RAG apps and semantic search.
AlloyDB vs Cloud SQL vs Cloud Spanner
| Aspect | Cloud SQL | AlloyDB | Cloud Spanner |
|---|---|---|---|
| Engine | MySQL / PG / SQL Server | PostgreSQL enhanced | Google's own SQL |
| Scale | TB (vertical) | TB (distributed) | Petabytes (global) |
| Built-in OLAP | No | Yes | No |
| Global | No | No (regional) | Yes (multi-region) |
| Price | Low | Medium-High | High |
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 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?
Put what you learned to the test with original CDL exam questions.
Start CDL mock examUnlimited mock exams with the Pro plan
Log in to track your progress.