Google Professional Cloud Developer Question 163
Single answerGoogle Cloud PlatformYour organization has a regulatory requirement to retain user activity logs for 7 years. You are building an application on Google Cloud, and these logs are stored in Cloud Storage. How can you ensure compliance with the data retention requirements while minimizing administrative overhead?
- A
Enable Object Versioning on the Cloud Storage bucket and manually delete older versions after 7 years.
- B
Set a bucket Lifecycle Management policy to automatically delete objects older than 7 years.
- C
Use Cloud Pub/Sub to notify administrators to review and delete logs older than 7 years.
- D
Set up a Cloud Function to periodically check and delete objects older than 7 years.
Show answer and explanation
Correct answer: B
Explanation
Setting a bucket Lifecycle Management policy in Cloud Storage is a built-in feature that allows you to define rules for retaining and deleting objects based on their age. This approach is automated, simple to configure, and ensures compliance with data retention requirements while minimizing administrative overhead. Other options either require manual intervention, additional custom code, or introduce unnecessary complexity.
- A. Incorrect.
While Object Versioning allows you to keep older versions of objects, it does not automatically manage retention or deletion. Manual deletion would introduce significant administrative overhead and risk of human error.
- B. Correct.
Using a bucket Lifecycle Management policy is the correct approach. It allows you to define automatic rules to delete objects older than 7 years, ensuring compliance with the retention requirement while minimizing administrative overhead.
- C. Incorrect.
Cloud Pub/Sub can notify administrators, but this approach requires manual intervention and increases administrative overhead, making it less efficient and prone to errors.
- D. Incorrect.
Using a Cloud Function to periodically delete objects is possible but requires custom code, maintenance, and monitoring, which introduces unnecessary complexity compared to using Lifecycle Management policies.