Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Delete then Write vs. Read and Filter

Hello 👋
The docs suggest doing a delete then write if you want to maintain a single value in a column: https://cloud.google.com/bigtable/docs/keep-only-latest-value

I'm wondering if it's generally more performant to do it this way, or if it would be better to have a max version = 1 policy on the column family, and then when reading, apply a filter to get the most recent version of the data since it would return multiple values until garbage collection occurs.

Thanks

Solved Solved
0 1 57
1 ACCEPTED SOLUTION

Hi there,

The recommended approach (eagerly deleting old data when writing) is the most performant. It frees up storage faster, which reduces the amount of data reads need to sort through. Note that the recommendation is to delete and then rewrite the data in one atomic request,  not two separate requests.

View solution in original post

1 REPLY 1

Hi there,

The recommended approach (eagerly deleting old data when writing) is the most performant. It frees up storage faster, which reduces the amount of data reads need to sort through. Note that the recommendation is to delete and then rewrite the data in one atomic request,  not two separate requests.