Associate Data Practitioner · Domain 4: Data Management · 25% of the exam
Task 4.2: Configure lifecycle management.
Cloud Storage classes by access frequency and retention, rules that delete old objects and expire BigQuery tables and partitions, and services for archiving data.
Study it
Cloud Storage classes, lifecycle rules and archiving
Try each one before opening the answer. Every option is explained, with the Google Cloud documentation page that proves it.
Question 1 · choose 1
Raw export files land in a bucket whose default storage class is Nearline. The bucket keeps the default soft delete policy, and a lifecycle rule deletes each file when it is 25 days old. Nobody reads the files after they land, and no one restores them. For the storage of one such file, what does Cloud Storage bill?
A25 days of Nearline storage, plus an early deletion charge for the 5 days left of the 30-day minimum
B25 days of Nearline storage only, because soft-deleted objects are not billed
C32 days of Nearline storage, 25 live and 7 soft-deleted, and no early deletion charge
D32 days of Nearline storage, plus an early deletion charge because the rule deleted the file before day 30
Show the answer and why
A25 days of Nearline storage, plus an early deletion charge for the 5 days left of the 30-day minimum
Incorrect
A file deleted by the rule becomes soft-deleted and is permanently deleted only after the 7-day retention; soft-deleted time counts toward the minimum, so the 30 days are reached before any early deletion.
B25 days of Nearline storage only, because soft-deleted objects are not billed
Incorrect
Soft-deleted objects keep accruing storage charges until their retention period ends and they are permanently deleted.
C32 days of Nearline storage, 25 live and 7 soft-deleted, and no early deletion charge
Correct
The lifecycle deletion makes the file soft-deleted for the default 7 days, which are billed like live storage, and the file reaches the 30-day minimum before it is permanently deleted.
D32 days of Nearline storage, plus an early deletion charge because the rule deleted the file before day 30
Incorrect
Early deletion charges apply when an object is permanently deleted before its minimum duration; this file is permanently deleted on day 32, after the 30-day minimum.
Objects deleted by Object Lifecycle Management become soft-deleted when soft delete is on (7-day retention by default). Soft-deleted objects are billed like live ones until they are permanently deleted, and the time an object spends live and soft-deleted together counts toward the minimum storage duration of its class (30 days for Nearline). An early deletion charge applies only if permanent deletion comes before that minimum.
A bucket has a retention policy of one year. An engineer adds a lifecycle rule with the action Delete and the condition age 90 days, hoping to remove old files sooner to save money. What happens to an object that turns 90 days old?
AThe rule deletes it at 90 days, because lifecycle rules take precedence over the retention policy
BIt is kept until its one-year retention period is fulfilled, and then the rule deletes it
CThe bucket rejects the lifecycle configuration, because Delete rules are not allowed with a retention policy
DThe retention period of every object is shortened to 90 days to match the rule
Show the answer and why
AThe rule deletes it at 90 days, because lifecycle rules take precedence over the retention policy
Incorrect
The Delete action does not take effect on an object that has not yet fulfilled its retention policy.
BIt is kept until its one-year retention period is fulfilled, and then the rule deletes it
Correct
Delete waits while an object is under an unfulfilled retention policy or a hold; as long as its conditions are still met, the deletion happens once the retention period ends.
CThe bucket rejects the lifecycle configuration, because Delete rules are not allowed with a retention policy
Incorrect
The configuration is accepted; the retention policy only delays the Delete action for objects that are still retained.
DThe retention period of every object is shortened to 90 days to match the rule
Incorrect
A lifecycle rule cannot change a bucket's retention policy; objects stay protected for the full retention period.
Object Lifecycle Management and retention work together: the Delete action is postponed while an object has a hold or an unfulfilled retention policy, and runs afterwards if its conditions are still satisfied. The retention policy applies to existing and new objects in the bucket alike.
An analyst built a large, unpartitioned working table, `sandbox.q4_extract`, that is needed only until the end of the year. It should be removed automatically on 31 December, while the other tables in the sandbox dataset and any tables created there later keep their current settings. Which statement does that?
A`ALTER SCHEMA sandbox SET OPTIONS (default_table_expiration_days = 60)`
C`ALTER TABLE sandbox.q4_extract SET OPTIONS (partition_expiration_days = 60)`
D`ALTER SCHEMA sandbox SET OPTIONS (max_time_travel_hours = 48)`
Show the answer and why
A`ALTER SCHEMA sandbox SET OPTIONS (default_table_expiration_days = 60)`
Incorrect
A dataset's default table expiration applies to tables created in the dataset afterwards, so it changes behavior for future tables and does not target this one.
A table's own expiration time (its time to live) deletes that table at the given timestamp and overrides the dataset default for it alone.
C`ALTER TABLE sandbox.q4_extract SET OPTIONS (partition_expiration_days = 60)`
Incorrect
Partition expiration removes old partitions of a partitioned table; this table has no partitions, and the option would not delete the table.
D`ALTER SCHEMA sandbox SET OPTIONS (max_time_travel_hours = 48)`
Incorrect
The time travel window sets how long changed or deleted data stays recoverable; it does not delete any table.
BigQuery removes data automatically through expirations: a table's expiration_timestamp deletes that table, a dataset's default table expiration sets the time to live of tables created later, and partition expiration deletes old partitions. The time travel window only controls how long deleted data can be recovered.
By mistake, a bucket's lifecycle configuration has two rules with exactly the same condition: one sets objects to Nearline storage and the other sets them to Coldline storage. What happens when an object meets the condition?
AThe object moves to Nearline, because that rule is listed first
BThe object moves to Nearline and then to Coldline a day later
CThe object moves to Coldline
DThe bucket rejects the configuration until one rule is removed
Show the answer and why
AThe object moves to Nearline, because that rule is listed first
Incorrect
Rule order does not decide the outcome; Cloud Storage applies a documented precedence between SetStorageClass actions.
BThe object moves to Nearline and then to Coldline a day later
Incorrect
When several rules match at the same time, Cloud Storage performs the action of only one of them.
CThe object moves to Coldline
Correct
When rules match at the same time, the SetStorageClass action that moves the object to the class with the lowest at-rest storage price takes precedence, which is Coldline here.
DThe bucket rejects the configuration until one rule is removed
Incorrect
Overlapping rules are allowed; Cloud Storage resolves them with its precedence rules.
If multiple lifecycle rules are satisfied at once for an object, Cloud Storage performs only one action: Delete takes precedence over SetStorageClass, and among SetStorageClass actions the one that switches to the class with the lowest at-rest storage price wins.
A bucket mixes long-term data with scratch files that a job writes under the `tmp/` folder. Only objects whose names start with `tmp/` should be deleted once they are older than 7 days. Which lifecycle rule does that?
This changes the scratch files' storage class instead of deleting them, so they keep using storage.
A lifecycle rule pairs an action (Delete, SetStorageClass and others) with conditions, and the action runs only when all conditions are satisfied. age counts days since the object was created; matchesPrefix and matchesSuffix match the beginning or end of the object name.
An application uploads invoices to a bucket, sometimes months before the invoice date, and sets each object's Custom-Time metadata to that date. Each invoice must be deleted 400 days after its invoice date, not after its upload date. Which lifecycle condition fits?
A`age: 400`
B`daysSinceCustomTime: 400`
C`createdBefore` set to a date 400 days ago
D`daysSinceNoncurrentTime: 400`
Show the answer and why
A`age: 400`
Incorrect
age is measured from the object's creation time, which here is the upload date rather than the invoice date.
B`daysSinceCustomTime: 400`
Correct
daysSinceCustomTime is satisfied when the given number of days has passed since the date in the object's Custom-Time metadata.
C`createdBefore` set to a date 400 days ago
Incorrect
createdBefore compares the object's creation time with a fixed date, which would need updating and still ignores the invoice date.
D`daysSinceNoncurrentTime: 400`
Incorrect
This condition counts days since an object became noncurrent under Object Versioning; live invoices never satisfy it.
Lifecycle conditions can work from different clocks: age and createdBefore use the creation time, daysSinceNoncurrentTime the moment a version became noncurrent, and daysSinceCustomTime a date that your application sets in the Custom-Time metadata.
A manager worries that moving old reports to Archive storage will make them slow to open, as with tape archives that must be restored first. What is true of reading data from colder Cloud Storage classes?
AArchive data must be restored to Standard storage before it can be read
BColdline and Archive reads are queued and served within hours
COnly Standard and Nearline objects can be read through the API
DEvery class offers low-latency access with no offline retrieval
Show the answer and why
AArchive data must be restored to Standard storage before it can be read
Incorrect
Cloud Storage has no restore step for colder classes; objects are read directly.
BColdline and Archive reads are queued and served within hours
Incorrect
All storage classes provide low-latency access without offline retrieval.
COnly Standard and Nearline objects can be read through the API
Incorrect
Every storage class uses the same tools and APIs for reading objects.
DEvery class offers low-latency access with no offline retrieval
Correct
Cloud Storage lists low latency with no offline data retrieval among the features of all storage classes; colder classes differ in price and access costs, not in access speed.
All Cloud Storage classes share low latency, high durability and the same APIs. The colder classes trade a lower storage price for higher costs of access and slightly lower availability.
A team is retiring a Spanner database next month. Auditors require a copy of its final contents to be kept for seven years and expect to read it rarely, if ever. Which approach keeps the copy for the whole period at a low storage cost?
ACreate a backup that expires in seven years and keep the instance for it
BCreate a backup, then delete the instance so that only the backup is billed
CExport the database to Avro files in Cloud Storage, using the Archive class
DRaise the database's version retention period to seven years before retiring it
Show the answer and why
ACreate a backup that expires in seven years and keep the instance for it
Incorrect
Spanner backups can be retained for up to a year from the time they are created, so a seven-year expiration is not possible.
BCreate a backup, then delete the instance so that only the backup is billed
Incorrect
A backup cannot outlive its parent instance, and Spanner does not let you delete an instance that still has backups.
CExport the database to Avro files in Cloud Storage, using the Archive class
Correct
An export writes Avro files to Cloud Storage, where they can stay for years; Archive storage is the lowest-cost class for data accessed less than once a year.
DRaise the database's version retention period to seven years before retiring it
Incorrect
The version retention period for point-in-time recovery can be raised to seven days at most, and it protects a database that keeps running.
Spanner point-in-time recovery reaches back at most seven days and backups at most a year, and backups live inside their instance, so a seven-year copy of a retired database calls for an export: the export job runs on Dataflow and writes Avro files and manifests to a Cloud Storage bucket, whose storage class can match how rarely the copy is read.
A team must keep raw BigQuery event data from 2019 for possible audits but will almost never read it, and wants it out of the warehouse at the lowest ongoing cost. Which approach fits, and what does the move itself cost in processing?
AExport the table with an extract job to a bucket that uses Archive storage; the extract job has no processing charge
BRun a SELECT * query into a new table in another dataset; the query is free because it copies data
CExport with an EXPORT DATA statement to a Standard bucket; the statement runs at no charge
DRead the table through the Storage Read API into files on a VM disk; reads are free
Show the answer and why
AExport the table with an extract job to a bucket that uses Archive storage; the extract job has no processing charge
Correct
Extract jobs that export table data to Cloud Storage are not charged for processing, and Archive storage is the lowest-cost class for data kept for audits and rarely accessed.
BRun a SELECT * query into a new table in another dataset; the query is free because it copies data
Incorrect
A query is billed for the bytes it processes, and the result stays in BigQuery storage, so it does not move the data out of the warehouse.
CExport with an EXPORT DATA statement to a Standard bucket; the statement runs at no charge
Incorrect
EXPORT DATA is billed for the compute of the query it runs, and Standard storage costs more than Archive for rarely read data.
DRead the table through the Storage Read API into files on a VM disk; reads are free
Incorrect
Storage Read API reads are billed for the data read, and a VM disk is not a low-cost archive.
BigQuery has several extraction modes: extract jobs to Cloud Storage with no processing charge, EXPORT DATA billed for the query compute, and the Storage Read API billed for data read. For rarely accessed archives, an extract job to an Archive-class bucket keeps both the move and the storage cheap.