- Newest
- Most votes
- Most comments
To optimize saving data in AWS Timestream and avoid getting an additional measure-name labeled 'timestamp', you should consider the following approach:
-
For the Dimension name: Use a descriptive name that represents the purpose of your timestamp, such as "event_time" or "record_timestamp". This should be a string without spaces.
-
For the Dimension value: Use the timestamp value you've created in Node-RED, but ensure it's properly formatted without extra spaces. You may need to trim any leading or trailing spaces in your Node-RED flow before sending the data to Timestream.
It's important to note that in Timestream, timestamps are typically used as the primary time column and not as dimensions. If you're trying to store multiple time-related fields, you have a few options:
- Use the main Timestream timestamp column for your primary timestamp.
- If you need an additional timestamp, you can store it as a measure with a TIMESTAMP data type. However, be aware that you can't use measures for deduplication.
- If the additional timestamp is crucial for your data model and needs to be used for deduplication, you could convert it to a string format and store it as a dimension. This allows you to use it for deduplication but sacrifices the ability to perform time-based operations on this field directly.
Remember, Timestream is optimized for time-series data, so structuring your data to take advantage of its built-in timestamp functionality will likely yield the best performance and query capabilities.
Lastly, when working with timestamps in AWS services, it's generally a good practice to use standardized formats. The default format in many AWS services is milliseconds since the Unix epoch, but you can also use other precise formats depending on your specific requirements.
By carefully considering your data model and timestamp usage, you can optimize your Timestream implementation and avoid unnecessary additional fields.
Sources
TimestreamTimestamp - AWS IoT
Multiple timestamp columns in AWS Timestream | AWS re:Post
TimestampPartition - AWS IoT Analytics
answered 2 years ago
Generally sensor_id or other metadata such as location are dimensions. Since you set timestamp as one of the dimension, its creating additional timestamp apart from default time column. https://docs.aws.amazon.com/iot/latest/developerguide/timestream-rule-action.html https://www.youtube.com/watch?v=TXIR7CAYemQ
answered 2 years ago
Relevant content
asked 2 years ago
asked 3 years ago
asked 2 years ago
- AWS OFFICIALUpdated 4 years ago
- AWS OFFICIALUpdated 3 years ago
