Javier Roda
Javier Roda

Reputation: 113

TTL on Google Cloud Bigtable

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?

Upvotes: 2

Views: 1748

Answers (2)

Solomon Duskis
Solomon Duskis

Reputation: 2711

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.

Upvotes: 2

Les Vogel
Les Vogel

Reputation: 7132

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

Upvotes: 5

Related Questions