Google Cloud Associate Data Practitioner — Question 47
You have a BigQuery dataset containing sales data. This data is actively queried for the first 6 months. After that, the data is not queried but needs to be retained for 3 years for compliance reasons. You need to implement a data management strategy that meets access and compliance requirements, while keeping cost and administrative overhead to a minimum. What should you do?
Answer options
- A. Use BigQuery long-term storage for the entire dataset. Set up a Cloud Run function to delete the data from BigQuery after 3 years.
- B. Partition a BigQuery table by month. After 6 months, export the data to Coldline storage. Implement a lifecycle policy to delete the data from Cloud Storage after 3 years.
- C. Set up a scheduled query to export the data to Cloud Storage after 6 months. Write a stored procedure to delete the data from BigQuery after 3 years.
- D. Store all data in a single BigQuery table without partitioning or lifecycle policies.
Correct answer: B
Explanation
The correct answer is B because partitioning the table by month allows for efficient data management, and exporting to Coldline storage minimizes costs for infrequently accessed data while maintaining compliance. Options A and D do not address cost efficiency effectively, and option C introduces unnecessary complexity with stored procedures and scheduled queries that can be avoided with a lifecycle policy.