SaveMyCert
Log in
5 of 5 free questions left today·for 10 a day
Exploring Data Transformation with Google Cloud

Google Cloud Data Products: Cloud SQL, Spanner, AlloyDB, Bigtable, BigQuery, Firestore and Storage Classes (Cloud Digital Leader)

16 min readCDL · Exploring Data Transformation with Google CloudUpdated

Google Cloud data management products are the managed services an organization uses to store, run and analyse its data: Cloud Storage for files, Cloud SQL, AlloyDB and Spanner for relational data, Bigtable and Firestore for NoSQL data, and BigQuery for analytics. This lesson covers task 2.2 of the Google Cloud Digital Leader exam guide. It defines the key terms (relational, non-relational, SQL, NoSQL and object storage), shows which product fits which business use case and why its closest alternative does not, explains how the Cloud Storage classes Standard, Nearline, Coldline and Archive trade storage price against retrieval cost, and when Autoclass should choose the class for you. It ends with the ways to migrate or modernize an existing database, and how Database Migration Service keeps downtime short.

What you’ll learn
  • Define relational, non-relational (NoSQL), SQL and object storage, and recognise which kind of data each suits
  • Choose among Cloud Storage, Cloud SQL, AlloyDB, Spanner, Bigtable, BigQuery and Firestore for a business use case
  • Distinguish near-twin products: Cloud SQL vs AlloyDB vs Spanner, Bigtable vs BigQuery, AlloyDB vs BigQuery for analytics
  • Select the Cloud Storage class (Standard, Nearline, Coldline, Archive) with the lowest total cost for an access pattern
  • Explain when to use Autoclass and how it differs from default classes and lifecycle rules
  • Describe rehost, replatform and refactor paths for a database, and when Database Migration Service's continuous mode is needed

Key data management terms: relational, SQL, non-relational, NoSQL and object storage

Five terms underpin every product choice in this topic. A relational database stores data in tables with a defined schema, links tables through keys and supports transactions. SQL (Structured Query Language) is the language used to query and change relational data. A non-relational or NoSQL database uses a more flexible model instead of linked tables. Object storage keeps whole files as objects, each with metadata, inside buckets.

TermHow data is organisedTypical business dataGoogle Cloud examples
RelationalTables with fixed columns, linked by keys (for example a customer ID shared by invoices and payments); queried with SQL joins; transactions keep related changes consistentOrders, invoices, bank balances, bookingsCloud SQL, AlloyDB for PostgreSQL, Spanner
Non-relational (NoSQL)Flexible schema: documents with their own fields, key-value pairs or wide-column rows looked up by keyProduct catalogues whose attributes vary, user profiles, sensor readings, app stateFirestore (document), Bigtable (wide-column)
Object storageWhole files stored and retrieved as units, with metadata, in bucketsImages, video, backups, exported files, raw data for a data lakeCloud Storage
Data warehouseStructured data from many systems, organised for analytical SQL over large volumesYears of sales history, reporting, BIBigQuery

A relational schema suits data whose shape is stable and whose records must stay consistent with each other. When records differ widely or their fields change often, every new attribute means altering the table definition; a NoSQL document model lets each record carry its own fields instead. Object storage is not a database at all: it gives no queries or updates on individual fields, but it is the cheapest and most durable home for files. Why data warehouses differ from operational databases and data lakes is covered in the task 2.1 lesson; here the focus is which Google Cloud product to pick.

Cloud Storage: object storage for unstructured files

Cloud Storage is Google Cloud's object storage service, the right choice for unstructured files that are stored and fetched whole. Typical examples are product photos, marketing and streaming video, nightly backup files, documents kept for retention, and raw files feeding a data lake. Apps and users download objects on demand, and Cloud Storage keeps them durably at low cost without any servers to manage.

The signal in a business scenario is the word file: images, clips, scans, exports, backups. Data that changes record by record through transactions (an account balance), rows joined with SQL, or app data that must sync to phones in real time needs a database instead. Cost within Cloud Storage is controlled by storage classes, covered later in this lesson.

Cloud SQL, AlloyDB and Spanner: choosing a relational database

All three are fully managed relational databases that speak SQL and support transactions. They differ in engine, performance profile and scale, and that difference decides the choice.

Cloud SQLAlloyDB for PostgreSQLSpanner
What it isManaged MySQL, PostgreSQL and SQL ServerManaged, PostgreSQL-compatible database built by Google for higher performance than standard PostgreSQLGoogle's relational database that scales horizontally, across regions, with strong consistency
Best fitStandard regional business apps that want the same engine they run today without the administrationDemanding PostgreSQL workloads, and apps that also need fast analytical queries on their live operational dataGlobal transactional systems, or relational workloads that have outgrown a single server
How it scalesA primary instance (you size it up) with read replicasA primary with read pool instances; a columnar engine accelerates analyticsScales out by adding capacity; no single-server ceiling
Engine change needed?No, for MySQL, PostgreSQL or SQL ServerNo, for PostgreSQL; yes from any other engineUsually yes: the app is adapted to Spanner (it offers GoogleSQL and PostgreSQL dialects)

Cloud SQL is the default for a company that runs MySQL, PostgreSQL or SQL Server itself and wants to hand routine database administration (updates, backup schedules, replicas) to Google while the application code stays as it is. When a scenario says it must keep the same engine and that engine is SQL Server or MySQL, Cloud SQL is the only one of the three that runs it.

AlloyDB for PostgreSQL is for PostgreSQL workloads that need more performance than standard PostgreSQL. Its built-in columnar engine lets managers run fast analytical queries on the current operational data in the same database, so operational data does not have to be exported to another system before it can be analysed. Cloud SQL for PostgreSQL keeps the engine too, but runs standard PostgreSQL and is not designed for analytics on live data.

Spanner is for transactions that must stay consistent at very large or global scale: account balances updated by users on several continents, a payments ledger that must agree everywhere at once, reservations that must never be double-booked. Cloud SQL is relational but relies on a single primary instance in one region, so once the largest available server cannot absorb the load, scaling up no longer helps; Spanner scales out instead while keeping SQL and strongly consistent transactions.

Bigtable and Firestore: choosing a NoSQL database

Google Cloud's two main NoSQL databases solve different problems. Bigtable is a wide-column database for enormous volumes of reads and writes at very low latency. Firestore is a serverless document database for mobile and web applications.

BigtableFirestore
Data modelWide-column rows looked up by a row keyDocuments with flexible fields, grouped in collections
StrengthVery high throughput and single-digit-millisecond lookups over billions of rowsReal-time updates pushed to devices, offline support, serverless scaling
Typical usesIoT sensor readings, time series, ad-click and event data, financial market data, personalization profiles served on every page loadMobile and web app data: user profiles, to-do lists, chat, product catalogues with varying attributes
Not forMulti-table SQL joins, ad hoc reporting, app data synced to phonesMassive analytical scans or heavy time-series ingestion

Bigtable is often confused with BigQuery because both handle huge data. The difference is the access pattern: Bigtable serves a known record by key in milliseconds on every request, while BigQuery runs analytical queries that scan large datasets. Bigtable is also not relational, so a workload that needs SQL transactions at scale points to Spanner, not Bigtable.

Firestore's signature features are real-time listeners (a change on one device appears on the user's other devices immediately) and offline support (the app keeps working without a connection and syncs later). With no instances to manage, it suits startups building mobile apps.

BigQuery: the serverless data warehouse for analytics

BigQuery is Google Cloud's serverless data warehouse: analysts run SQL across terabytes or petabytes of data without managing any servers. It is the answer when the need is analysis over large volumes of history, such as years of sales, rather than running the live application.

The general rule is to keep analytical and operational workloads apart. Heavy analytical queries run against the database that serves an application compete with its transactions for the same resources. Loading the data into BigQuery gives analysis its own system, so it can span far more data without affecting the application; scaling up the operational database keeps both workloads on one system. BigQuery can also query some data where it lives through federated queries, but in most designs operational data is loaded or replicated into it.

Keep the distinction with AlloyDB clear: AlloyDB speeds analytics on the live data inside the operational database, while BigQuery is a separate warehouse built for analysis across many sources. How BigQuery feeds dashboards in Looker and how data streams into it with Pub/Sub and Dataflow are covered in the task 2.3 lesson.

Matching a business use case to the right product

Start from the deciding detail in the scenario, then match it to the one product built for it.

If the scenario needsChooseTempting near-twin and why it falls short
Files such as images, video or backups, fetched on demandCloud StorageA database: built for records and queries, not large files
Same MySQL, PostgreSQL or SQL Server engine, managed for you, one regionCloud SQLAlloyDB: PostgreSQL only; Spanner: global scale the app does not need
High-performance PostgreSQL, or fast analytics on live operational dataAlloyDB for PostgreSQLCloud SQL for PostgreSQL: same engine, standard performance
Consistent relational transactions across regions, or beyond one server's limitSpannerCloud SQL: single primary; Bigtable: scales but not relational
Massive write volume or millisecond key lookups (IoT, ad tech, personalization)BigtableBigQuery: analytical scans, not per-request lookups
SQL analytics over terabytes, serverlessBigQueryCloud SQL: operational database on instances
Mobile or web app data, real-time sync, offline use, serverlessFirestoreCloud SQL: instances and no device sync

Real organizations usually combine products, choosing one per workload. A streaming service, for example, might keep its video files in Cloud Storage, serve per-viewer recommendations from Bigtable and analyse viewing history in BigQuery. Evaluate each workload separately rather than looking for one database that does everything.

Cloud Storage classes: Standard, Nearline, Coldline and Archive

A storage class sets how much an object costs to store and to read. Colder classes have a lower storage price but charge a retrieval fee for each read and have a minimum storage duration; delete or move an object earlier and you pay as if it had stayed the minimum time. All four classes store data with the same high durability and return it with millisecond access; the difference is cost, not speed.

ClassDesigned for data read aboutMinimum storage durationCost profileExample
StandardFrequently (hot data)NoneHighest storage price, no retrieval feeWebsite images, active app content, data being analysed
NearlineOnce a month or less30 daysLower storage price, retrieval feeFiles read for a monthly report, recent backups
ColdlineOnce a quarter or less90 daysLower still, higher retrieval feeBackups restored for quarterly tests, disaster recovery copies
ArchiveLess than once a year365 daysLowest storage price, highest retrieval feeRecords kept for regulatory retention and read only at audit

The cheapest class is the one with the lowest total cost: storage price plus retrieval fees plus any early deletion charges. Frequently read data belongs in Standard even though its storage price is highest, because retrieval fees in a colder class would dominate the bill. Going one class too cold is a common mistake: whenever data is read more often than a class is designed for, its higher per-gigabyte retrieval fee is paid on every read and can outweigh the storage it saves. Match the class to the expected read frequency, not simply to the lowest storage price.

A bucket has a default storage class for new objects, and Object Lifecycle Management rules can move objects to colder classes by age. Age-based rules work well when access is predictable; they cannot know which old objects will suddenly be needed again.

Autoclass: automatic storage classes for unpredictable access

Autoclass is a Cloud Storage bucket setting that moves each object between storage classes automatically, based on that object's own access. It fits buckets whose access patterns are unknown, mixed or change over time, where no fixed class or schedule would suit every object.

  • How it moves data: new objects start in Standard. Objects that are not accessed move to colder classes over time (Nearline, then Coldline and Archive if the bucket's terminal class is set to Archive). When an object is read, Autoclass returns it to Standard.
  • How it is charged: Autoclass charges no retrieval fees and no early deletion fees for its transitions. Instead there is a small management fee per object, and very small objects stay in Standard and are not charged it.
  • How it relates to lifecycle rules: Autoclass takes over storage class decisions, so an Autoclass bucket cannot keep lifecycle rules that change storage class. Turning Autoclass on means removing those rules; rules that delete objects can still be used.

The principle is per-object adaptation: Autoclass reacts to how each object is actually used, while a bucket's default class only sets where new objects start and age-based rules follow a fixed timetable. Other bucket features that sound related, such as keeping older versions of objects or retention policies, protect data rather than choosing its class.

Migrating and modernizing a database in the cloud

An organization can move an existing database to Google Cloud in three broad ways, which trade speed of migration against how much management work and modernization it gains.

ApproachWhat happensGoogle Cloud exampleTrade-off
Rehost (lift and shift)Run the same database software on cloud virtual machines with almost no changeThe database installed on Compute Engine VMsFastest, but the company still patches, backs up and licenses the database itself
ReplatformMove to a managed service running the same or a compatible engineSelf-managed MySQL, PostgreSQL or SQL Server to Cloud SQL; PostgreSQL to AlloyDBLittle or no application change; Google takes over routine administration
Refactor or modernizeRework the application for a cloud-native database, or convert to a different engineOracle to AlloyDB or Cloud SQL for PostgreSQL; a database that has outgrown one server to SpannerMost effort, biggest gains: removes commercial licences, adds scale or new capabilities

Google's migration documentation also calls replatforming "lift and optimize" and refactoring "move and improve"; the exam guide's migration task (4.1) labels replatform "move and improve". The full set of migration terms, including retire and retain, is covered in the task 4.1 lesson.

Database Migration Service is Google Cloud's managed tool for these moves. It migrates MySQL, PostgreSQL and SQL Server into Cloud SQL, PostgreSQL into AlloyDB, and handles heterogeneous migrations, such as Oracle to AlloyDB or Cloud SQL for PostgreSQL, where conversion workspaces (assisted by Gemini) translate schemas and code such as stored procedures. It offers two modes:

  • Continuous migration: an initial copy, then ongoing replication of changes from the source. The source stays fully in use throughout, and the switch-over happens in a short cutover once the target is in sync.
  • One-time migration: a single copy taken at a point in time, which requires stopping writes to the source while it runs.

The principle is change data capture (CDC): a copy of a live database is only complete if every change made after the copy started is replicated too, which periodic export-and-load approaches cannot do. Organizations that must keep Oracle for now can also run it in Google Cloud through Oracle Database@Google Cloud, which keeps the Oracle engine (and its licensing) rather than modernizing away from it.

Tip. Questions on this topic are short business scenarios that ask which Google Cloud product or storage class fits a need, or which term describes a kind of database. Most options are real products from the same family, so the deciding detail matters: whether the data is files or records, whether the existing engine must be kept and which engine it is, whether transactions must stay consistent across regions or beyond one server, whether the need is a millisecond lookup or an analytical scan, whether an app needs real-time device sync, and how often stored data is read. Storage class items expect you to weigh storage price against retrieval fees and minimum durations, and to recognise when access is too unpredictable for any fixed class. Migration items describe a constraint such as downtime limits or licensing goals. Harder items combine two facts, and a few are Select TWO.

Key takeaways
  • Relational databases use linked tables, SQL and transactions; NoSQL databases use flexible models such as documents or wide-column rows; object storage keeps whole files in buckets.
  • Files such as images, video and backups go in Cloud Storage, not a database.
  • Cloud SQL runs managed MySQL, PostgreSQL and SQL Server for regional apps that want to keep their engine; it is the only choice of the three relational products for SQL Server.
  • AlloyDB is high-performance, PostgreSQL-compatible and speeds analytics on live operational data in the same database.
  • Spanner is relational with strong consistency and horizontal scale across regions: the choice for global transactions or a database that has outgrown one server.
  • Bigtable serves massive throughput and millisecond key lookups (IoT, ad tech, personalization); BigQuery runs serverless SQL analytics over huge datasets; Firestore syncs mobile and web app data in real time and offline.
  • Move heavy reporting off the transactional database into BigQuery; a bigger operational database does not separate the workloads.
  • Pick the storage class by total cost: Standard for frequent access, Nearline about monthly, Coldline about quarterly, Archive less than yearly; colder classes add retrieval fees and minimum durations.
  • Autoclass moves each object by its own access, returns read objects to Standard, charges no retrieval or early deletion fees (a management fee applies) and replaces class-changing lifecycle rules.
  • Database Migration Service migrates into Cloud SQL and AlloyDB, converts Oracle to PostgreSQL-compatible targets, and its continuous mode keeps the source live until a short cutover.

Frequently asked questions

What is the difference between Cloud SQL, AlloyDB and Spanner?

All three are fully managed relational databases on Google Cloud. Cloud SQL runs standard MySQL, PostgreSQL or SQL Server for regional applications that want to keep their existing engine. AlloyDB for PostgreSQL is PostgreSQL-compatible but built for higher performance, and it accelerates analytical queries on live operational data. Spanner scales horizontally across regions with strongly consistent transactions, so it suits global systems or workloads that have outgrown a single database server.

When should a business use Bigtable instead of BigQuery?

Use Bigtable when an application must write or read huge numbers of individual records with very low latency, such as IoT sensor readings, ad-click events or personalization profiles fetched on every page load. Use BigQuery when analysts need to run SQL queries that scan and summarise large datasets, such as years of sales history. Bigtable is an operational NoSQL database; BigQuery is a serverless data warehouse for analytics.

What is Firestore used for?

Firestore is Google Cloud's serverless NoSQL document database for mobile and web applications. Each record is a document with its own fields, changes are pushed to users' devices in real time, and apps keep working offline and sync when they reconnect. It suits app data such as user profiles, chat, to-do lists and product catalogues whose attributes vary.

Which Cloud Storage class is cheapest?

It depends on how often the data is read. Archive has the lowest storage price but the highest retrieval fee and a 365-day minimum, so it is cheapest only for data read less than once a year. Coldline suits data read about once a quarter, Nearline about once a month, and Standard, which has no retrieval fee, is cheapest for data read frequently. The right class has the lowest total of storage, retrieval and early deletion costs.

What does Autoclass do in Cloud Storage?

Autoclass is a bucket setting that automatically moves each object to a colder storage class when it is not accessed and back to Standard when it is read. It charges no retrieval or early deletion fees for these moves, only a small per-object management fee. It is meant for data whose access patterns are unknown or change, and a bucket using it cannot also have lifecycle rules that change storage class.

How can an organization migrate its database to Google Cloud?

It can rehost (lift and shift) the same database software onto Compute Engine virtual machines, replatform onto a managed service with the same engine such as Cloud SQL or AlloyDB, or refactor onto a different or cloud-native database such as converting Oracle to PostgreSQL or moving to Spanner. Database Migration Service manages migrations into Cloud SQL and AlloyDB, including Oracle-to-PostgreSQL conversions.

How does Database Migration Service minimise downtime?

In continuous migration mode, Database Migration Service copies the source database once and then keeps replicating every change to the target while the source stays in use. The application switches to the new database in a short cutover once the target is in sync. One-time migration mode copies the data at a single point in time and requires stopping writes during the copy.

Source

This lesson covers the "Exploring Data Transformation with Google Cloud" domain of the official CDL exam guide. Vendors revise their guides — check the source for the current version.

Sign up free to mark lessons complete, bookmark topics and track your exam readiness.

Spotted a mistake in this lesson?