Google Cloud Professional Cloud Architect — Question 8
Your applications will be writing their logs to BigQuery for analysis. Each application should have its own table. Any logs older than 45 days should be removed.
You want to optimize storage and follow Google-recommended practices. What should you do?
Answer options
- A. Configure the expiration time for your tables at 45 days
- B. Make the tables time-partitioned, and configure the partition expiration at 45 days
- C. Rely on BigQuery's default behavior to prune application logs older than 45 days
- D. Create a script that uses the BigQuery command line tool (bq) to remove records older than 45 days
Correct answer: B
Explanation
The correct answer is B because time-partitioned tables allow for automatic management of data expiration on a per-partition basis, optimizing storage while adhering to best practices. Option A would apply the expiration to the entire table rather than individual partitions, while option C does not ensure proactive management of data. Option D requires manual intervention and does not leverage BigQuery's built-in partitioning features.