You may have a reason, not related to garbage collection, to assign sequential numbers to the timestamp property for a cell, rather than assigning a date and time. This page describes Cloud Bigtable garbage collection for data with this type of artificial timestamps.
Before you read this page, you should read the overview of garbage collection, including the description of real and artificial timestamps.
Number of versions
If timestamps are sequence numbers, your garbage-collection policy should be based on the number of versions. An age-based garbage-collection policy is unsafe in this case, because age-based policies remove data based on the timestamp.
- You are able to use monotonically increasing timestamps if you need to.
You cannot switch to age-based garbage collection.
Because your timestamps aren't an actual date and time, you cannot use the cells' timestamps for any other use case, such as determining how old a value is. As a workaround, you can write a real timestamp to a separate column, but this will increase the amount of data you store.
Because garbage collection is asynchronous, you still should always use filters when you read the data.
- Read an overview of Bigtable garbage collection.
- Explore strategies to simulate cell-level TTL.
- Learn one method to always read the most recent value of a column.
- Review code samples showing how to configure garbage collection.
- Learn more about storage pricing.