nerdexam
Google

PROFESSIONAL-DATA-ENGINEER · Question #363

You work for a large ecommerce company. You store your customer's order data in Bigtable. You have a garbage collection policy set to delete the data after 30 days and the number of versions is set…

The correct answer is B. Use a timestamp range filter in the query to fetch the customer's data for a specific range. Option B is correct because Bigtable's garbage collection is not instantaneous - it runs during background compactions, meaning data past the 30-day threshold can still be physically present and queryable until the next compaction cycle. Adding a timestamp range filter to the…

Submitted by suresh_in· Mar 30, 2026Designing data processing systems

Question

You work for a large ecommerce company. You store your customer's order data in Bigtable. You have a garbage collection policy set to delete the data after 30 days and the number of versions is set to 1. When the data analysts run a query to report total customer spending, the analysts sometimes see customer data that is older than 30 days. You need to ensure that the analysts do not see customer data older than 30 days while minimizing cost and overhead. What should you do?

Options

  • ASet the expiring values of the column families to 29 days and keep the number of versions to 1.
  • BUse a timestamp range filter in the query to fetch the customer's data for a specific range.
  • CSchedule a job daily to scan the data in the table and delete data older than 30 days.
  • DSet the expiring values of the column families to 30 days and set the number of versions to 2.

How the community answered

(27 responses)
  • A
    19% (5)
  • B
    70% (19)
  • C
    7% (2)
  • D
    4% (1)

Explanation

Option B is correct because Bigtable's garbage collection is not instantaneous - it runs during background compactions, meaning data past the 30-day threshold can still be physically present and queryable until the next compaction cycle. Adding a timestamp range filter to the query enforces the 30-day window at read time, giving analysts a precise and immediate boundary without waiting for GC to catch up, and it requires no infrastructure changes or additional cost.

A is wrong because reducing expiry to 29 days doesn't fix the root cause - GC still runs lazily, so stale data can still appear; it also unnecessarily tightens the retention window. C is wrong because a daily scan-and-delete job adds significant operational overhead and cost, directly violating the constraint. D is wrong because increasing versions to 2 would actually surface more old data to analysts, making the problem worse, not better.

Memory tip: Think of Bigtable GC as "eventual" - data will be deleted, just not right now. When you need a hard time boundary at query time, a timestamp filter is your scalpel; GC policy is just the scheduled cleanup crew.

Topics

#Bigtable#Garbage Collection#Query Filtering#Data Retention

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-DATA-ENGINEER Practice