Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
Google Cloud · Professional Data Engineer

Costs, performance, and lifecycle

Professional Data Engineer · Lesson 12 of 23 · 1:26:53

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the Google Cloud Professional Data Engineer exam, on the official exam guide. In this lesson: Cloud Storage classes, Autoclass, lifecycle rules, and retention, BigQuery storage costs and long-term storage, and partitioning and clustering. Includes three original practice questions, with Cymbal Mobility, a fictional ride-hailing and scooter company, as the example.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

A bill that doubles

Cymbal Mobility's storage bill doubles every year. Raw sensor files are read for a week, then almost never, and old trip tables sit untouched in BigQuery. Regulators also require ride data to be kept for five years, and protected from deletion.

Cloud Storage classes

Cloud Storage has four storage classes, for different access frequencies. Standard is for data read often, and has no minimum storage duration. Nearline, Coldline, and Archive cost less to store, but charge for retrieval, and have minimum durations of thirty, ninety, and three hundred sixty-five days. Choose the class from how often the data is read, not from its age alone. Location matters too: a region, a dual-region, or a multi-region changes cost, latency, and availability.

Lifecycle and retention

Object Lifecycle Management applies rules to a bucket, for example: move objects to Coldline after ninety days, and delete them after five years. When access is unpredictable, Autoclass moves each object by its own access: to Nearline after thirty days without access, Coldline after ninety, Archive after a year, and back to Standard when it is read, with no retrieval fees. Soft delete keeps deleted objects for seven days by default, and object versioning keeps older versions of objects. For compliance, a retention policy prevents deleting or replacing objects before a set age. And Bucket Lock makes that policy permanent, so nobody can shorten or remove it.

BigQuery storage costs

BigQuery charges for storage separately from queries. A table or partition that is not modified for ninety days moves to long-term storage automatically, and its price drops by about half, with no loss of performance. Datasets can be charged for logical bytes, uncompressed, or for physical bytes, compressed, which often costs less for data that compresses well, but then time travel storage is charged too. Time travel keeps changed or deleted data for two to seven days, followed by a fail-safe period of seven days. And expirations on datasets, tables, or partitions delete data automatically, once it has served its purpose.

Partitioning and clustering

Partitioning splits a table into segments, by a date or timestamp column, by ingestion time, or by integer ranges. A query that filters on the partitioning column reads only the matching partitions, which lowers both cost and time, and you can require a partition filter on every query. Clustering sorts the data in storage blocks by up to four columns, like city and vehicle type, so filters on those columns skip blocks. Partition on the column most queries filter by, like the trip date, and cluster on the columns used next in filters. And avoid many tiny partitions: below about ten gigabytes per partition, clustering alone is often better.

Recap

Let's recap. Choose a Cloud Storage class by access frequency, knowing that colder classes charge for retrieval and have minimum durations. Lifecycle rules change classes or delete objects by age, Autoclass follows each object's access, and retention policies with Bucket Lock protect data for compliance. In BigQuery, untouched data becomes long-term storage automatically, and physical billing often costs less for compressible data. Time travel and expirations control how long data stays. And partition by the main filter column, cluster by the next ones, and avoid tiny partitions.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. Sensor files are read often for a week, then rarely, but some are read again at unpredictable times. The team wants lower costs, no rules to maintain, and no retrieval fees. What should the data engineer enable?

    • A lifecycle rule moving files to Archive after 7 days
    • Autoclass on the bucket
    • Coldline as the bucket’s default class
    • Object versioning on the bucket
    Show the answer

    Autoclass on the bucket

    Autoclass moves each object by its own access, and charges no retrieval fees when a file is read again. “A lifecycle rule moving files to Archive after 7 days” would put files that are read again into Archive, with retrieval fees and a one-year minimum. “Coldline as the bucket’s default class” would charge retrieval fees during the first week of frequent reads. And “Object versioning on the bucket” only keeps older versions, which adds storage.

  2. Trip partitions older than three years must be deleted automatically, and old partitions are never modified. What should the data engineer set?

    • Long-term storage on the old partitions
    • Physical storage billing on the dataset
    • A time travel window of two days
    • A partition expiration of three years
    Show the answer

    A partition expiration of three years

    A partition expiration deletes each partition automatically, once it reaches that age. “Long-term storage on the old partitions” happens on its own after ninety days without changes, and only lowers the price. “Physical storage billing on the dataset” changes how storage is charged, and deletes nothing. And “A time travel window of two days” only shortens how long changed or deleted data can be recovered.

  3. Analysts query the trips table by trip date, and usually also by city. Every query scans the whole table, and costs keep rising. What should the data engineer do?

    • Partition by trip date, and cluster by city
    • Switch the dataset to physical storage billing
    • Create one separate table for each city
    • Wait for the table to become long-term storage
    Show the answer

    Partition by trip date, and cluster by city

    Partitioning by trip date limits each query to the dates it needs, and clustering by city skips blocks within them. “Switch the dataset to physical storage billing” only changes how storage is charged, not what queries read. “Create one separate table for each city” would make every query scan many tables, with harder SQL. And “Wait for the table to become long-term storage” only lowers the storage price, and queries would still scan everything.