Search code examples
database-designbigtablegoogle-cloud-bigtable

What should I put in my Bigtable cell timestamp?


I'm using Bigtable to store time-series data similar to the instructions in the user guide where my row key is like:

userID#componentID#eventTimestamp

And I may have one or more columns of different values that may have been updated at that time.

Because my timestamp is now a part of the row key, what value should I set in the cell's individual timestamp? I'm thinking that perhaps the cell timestamp can be the time of mutation? This can be used to track the time the cell was last updated.

Or would there be any benefit of settings the cell's timestamp to the same one as the row key?


Solution

  • Unless your application actually is going to use the cell timestamp, it doesn't matter and you can forgo setting it. Some situations where you might want to set it are:

    • You are using time based garbage collection.
    • Data can be edited, and you need to track when it was last updated
    • You have multiple columns and want to track when each one was written