Google Professional Cloud Developer Question 164
Select 3Google Cloud PlatformYour company requires storing user activity logs for 7 years to comply with regulatory data retention policies. You are designing a solution on Google Cloud to store these logs in a cost-effective manner, while ensuring they remain accessible if needed. Which of the following approaches should you use?
- A
Store the logs in a Google Cloud Storage bucket with a Nearline storage class and apply a Bucket Lock with a retention policy of 7 years.
- B
Store the logs in Firestore with a TTL (Time-To-Live) policy configured to delete data after 7 years.
- C
Use BigQuery to store the logs and enable table expiration for 7 years, ensuring audit logs are exported to Cloud Storage for long-term retrieval.
- D
Store the logs in a Google Cloud Storage bucket with a Coldline storage class and use Object Lifecycle Management to delete objects older than 7 years.
- E
Use Cloud Spanner to store the logs and manually delete records older than 7 years using a scheduled task.
Show answer and explanation
Correct answers: A, C, D
Explanation
For long-term data retention meeting regulatory requirements, Google Cloud Storage with Bucket Lock or Object Lifecycle Management, combined with cost-effective storage classes such as Nearline or Coldline, is ideal. BigQuery with table expiration and export to Cloud Storage is also a valid approach for storing and archiving logs. Firestore and Cloud Spanner are not suitable for this use case due to their limitations in cost-effectiveness and compliance for regulatory data retention.
- A. Correct.
This option is correct because Nearline storage is cost-effective for infrequent access, and Bucket Lock ensures that the logs cannot be deleted or modified before the retention period ends, meeting regulatory requirements.
- B. Incorrect.
This option is incorrect because Firestore TTL does not meet strict regulatory compliance needs for data retention, as data can still be modified or deleted before the TTL period ends.
- C. Correct.
This option is correct because BigQuery supports long-term storage of logs and allows you to configure table expiration. Exporting logs to Cloud Storage ensures compliance with long-term retention policies.
- D. Correct.
This option is correct because Coldline storage is optimized for long-term archival with low access frequency, and Object Lifecycle Management can automate deletion of objects older than 7 years.
- E. Incorrect.
This option is incorrect because Cloud Spanner is not typically used for cost-effective long-term archival storage. It is primarily designed for transactional workloads, and manual deletion is error-prone for regulatory compliance.