Skip to content

Optimizing saving data

-1

“I used Node-RED to create a timestamp variable in my node for my role. However, this adds an extra space when I save it in timestream. What should I enter for the Dimension name and Dimension value to avoid getting an additional measure-name labeled ‘timestamp’?”

Enter image description here Enter image description here

2 Answers
0

To optimize saving data in AWS Timestream and avoid getting an additional measure-name labeled 'timestamp', you should consider the following approach:

  1. 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.

  2. 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:

  1. Use the main Timestream timestamp column for your primary timestamp.
  2. 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.
  3. 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

0

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

AWS

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.