A retail enterprise dumps 5-GB JSON sales files every day into a gs://sales-raw bucket whose default storage class is Standard. Business analysts query only the most recent 14 days. Auditors may request any file up to seven years old, but the business wants to minimise storage cost after the active window. You must implement Object Lifecycle Management so that each object is rewritten exactly once during its lifetime. Which rule set meets the requirement?
Single rule with Age = 14 days that specifies sequential actions: Nearline, then Archive, then Delete.
Rule 1: Age = 14 days AND MatchesStorageClass = Standard → SetStorageClass = Nearline Rule 2: Age = 90 days AND MatchesStorageClass = Nearline → SetStorageClass = Archive Rule 3: Age = 2555 days → Delete
Rule 1: Age = 14 days → SetStorageClass = Nearline; Rule 2: Age = 2555 days → Delete.
Rule 1: Age = 14 days → SetStorageClass = Nearline Rule 2: Age = 90 days → SetStorageClass = Archive Rule 3: Age = 2555 days → Delete
The safest way to guarantee that an object is rewritten only once per transition is to combine an Age condition with a MatchesStorageClass filter for every SetStorageClass action.
At day 14 the object is still in Standard, so a rule that requires Age = 14 and MatchesStorageClass = Standard migrates it to the cheaper Nearline class.
At day 90 the object resides in Nearline, so a second rule with Age = 90 and MatchesStorageClass = Nearline moves it to Archive for long-term retention.
A final rule that deletes the object when Age ≥ 2555 days (≈7 years) completes the policy. Because each SetStorageClass rule can match an object only while it is in the specified source class, the object will never satisfy more than one rewrite rule, ensuring exactly one rewrite per transition while meeting the cost and retention requirements.
Other options either omit the Archive tier, would keep data in a more expensive class for years, or rely on overlapping Age-only rules that can trigger additional, unnecessary rewrites.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is Object Lifecycle Management in GCP?
Open an interactive chat with Bash
What is the difference between Standard, Nearline, and Archive storage classes?
Open an interactive chat with Bash
How do MatchesStorageClass and Age conditions work together in lifecycle rules?
Open an interactive chat with Bash
What is Object Lifecycle Management in GCP?
Open an interactive chat with Bash
What are GCP’s storage classes and their use cases?
Open an interactive chat with Bash
Why do we use MatchesStorageClass filters in GCP Lifecycle rules?
Open an interactive chat with Bash
GCP Professional Data Engineer
Storing the data
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .