How to prevent reading expired Bigtable data?
Short answer
B Use a timestamp range filter in the query to fetch the customer's data for a specific range.
Question
Key Takeaways
This question tests the understanding that Bigtable garbage collection is eventual and not immediate, creating a trap where users rely solely on GC policies for read consistency.
Bigtable garbage collection is an asynchronous process that does not immediately delete expired data, potentially leaving records visible for up to a week. The community consensus is that applying a timestamp range filter at query time is the most effective method to ensure analysts only see data within the desired 30-day window.
Common mistake: A common mistake is choosing to schedule a manual deletion job (Option C), which introduces unnecessary overhead and cost compared to simply filtering read requests.
Expert Analysis
Why the Answer Is Correct
Option B is correct because Bigtable's garbage collection runs asynchronously and can take up to seven days to actually remove data marked for deletion. Therefore, to guarantee that a query never returns data older than 30 days, you must explicitly filter the results by timestamp during the read operation. This method enforces the business logic without incurring the cost of manual scans or changing the underlying storage policy.
Why the Other Options Are Wrong
Option A is incorrect because reducing the TTL to 29 days changes the data retention requirement rather than solving the visibility lag issue. Option C is incorrect because manually scanning and deleting data is expensive, operationally heavy, and redundant given the built-in GC mechanisms. Option D is incorrect because increasing the number of versions to 2 would actually increase the likelihood of seeing older data, contrary to the goal.
Community Comment Notes
Community members consistently cite the official Google Cloud documentation stating that GC can take up to a week to execute. Comments emphasize the best practice of mirroring GC rules in read filters to ensure data consistency, as relying solely on server-side expiration is unreliable for immediate query constraints.
Official Reference
https://cloud.google.com/bigtable/docs/garbage-collection
This link opens the official vendor documentation in a new tab.
Exam Strategy
When encountering questions about Time-to-Live (TTL) or garbage collection in distributed databases, remember that deletion is an eventual, background process. If the scenario requires strict data exclusion at the moment of reading, always prioritize filtering the query results over modifying storage policies or manual deletion jobs.
Community Votes
100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 7 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 7
-
Matt_108 👍 8 Answered BAgree with others https://cloud.google.com/bigtable/docs/garbage-collection
-
cuadradobertolinisebastiancami 👍 6 Answered BAgree with MAtt_108 and AllenChen 123. "Garbage collection is a continuous process in which Bigtable checks the rules for each column family and deletes expired and obsolete data accordingly. In general, it can take up to a week from the time that data matches the criteria in the rules for the data to actually be deleted. You are not able to change the timing of garbage collection." "Always apply a filter to your read requests that exclude the same values as your garbage collection rules. " Ref: https://cloud.google.com/bigtable/docs/garbage-collection#data-removed
-
GCP001 👍 3B. Use a timestamp range filter in the query to fetch the customer's data for a specific range. Always use query filter as garbage collectore runs on it's way - https://cloud.google.com/bigtable/docs/garbage-collection
-
m_a_p_s 👍 1 Answered B"Because it can take up to a week for expired data to be deleted, you should never rely solely on garbage collection policies to ensure that read requests return the desired data. Always apply a filter to your read requests that excludes the same values as your garbage collection rules. You can filter by limiting the number of cells per column or by specifying a timestamp range." https://cloud.google.com/bigtable/docs/garbage-collection#data-removed
-
Pime13 👍 1 Answered BBecause it can take up to a week for expired data to be deleted, you should never rely solely on garbage collection policies to ensure that read requests return the desired data. Always apply a filter to your read requests that excludes the same values as your garbage collection rules. You can filter by limiting the number of cells per column or by specifying a timestamp range.
Show 2 more comments
-
scaenruy 👍 1 Answered BB. Use a timestamp range filter in the query to fetch the customer's data for a specific range.
-
Sofiia98 👍 1 Answered BI will go for B too
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.