2
votes

I have a table with only one column family, this column has a TTL of 24 hours but I need some data to be deleted before the deadline.

To get this goal I faked the insert date. For example: if I need a row to be deleted 1 hour after the insert, I set the insert date 23 hours ago. This mechanism works fine, Bigtable deleted my data after one hour, but I don't know if this can produce errors in internal workflow of Bigtable.

Can I continue using this or is there other way to do that?

2

2 Answers

5
votes

You can set the timestamp to anything you want. Your use case shouldn't cause issues for Cloud Bigtable.

2
votes

As Les said, your usage of the timestamp to 23 hours ago is perfectly fine, and will not cause internal problems. FYI, the TTL works, but is not on a precise schedule; it happens along with other maintenance, like compaction.