- Newest
- Most votes
- Most comments
I can help answer the questions related to AWS IoT Core and the Kinesis Data Stream (KDS) action. As the synthesis of data is downstream of IoT Core and API Gateway, I assume you are looking for correlated timestamps there. So to answer the IoT side of this question:
How can I ensure the data is coupled in the same timestamp, meaning the sensor data at 12:00:00 is coupled with the weather data at 12:00:00?
Depending upon the resolution needed, if the sending devices have good a time source such as NTP (~1ms from upstream stratums), you could inject the timestamp as part of the MQTT application message (payload). That can then parsed by Kinesis Data Anayltics (KDA) or applications reading from Kinesis Data Firehouse for correlation.
If the devices do not have a precise time source, you can use the IoT Rules Engine to add a timestamp key value pair. Note: there will be short duration of 10s to 100s of milliseconds added time due to the publish from the device to AWS IoT Core, and then delivery to the Rules Engine. Something to take into consideration if correlation <1sec is needed.
Adding the timestap is easy if the payload is JSON. You can use something like SELECT *, timestamp() as my_timestamp
as part of the rule., If it isn't JSON and some form of binary, you can still create a new payload format in JSON where the binary payload is base64 encoded. In might look something like this:
{ "timestamp": 1481825251155, "payload": "eyAidGVtcGVyYXR1cmUiOiAzMyB9Cg==" }
I'm not a Kinesis expert, so will defer to others on best practices for 1 v 2 streams and what a KDA application might look like.
Hope this helps, please let me know if you have follow up questions!
Relevant content
- Accepted Answerasked 4 years ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 3 months ago