2

I am trying to store GPS coordinates of devices for which I receive multiple updates every minute. I decided to use AWS TimeStream since all of the data that I am collecting are time series, but now when I am trying to query information that is in a specific area, I need to do complex computation in the query, similar to this solution.

Since there does not seem to be any spaciotemporal database available, what are my option ? I would like to query the database based on time and gps coordinates, but I am not familiar enough with time series DB and geospatial DB to understand properly the tradeoffs

TSpark
  • 189
  • 1
  • 14

1 Answers1

0

If you receive the sensor telemetry through AWS IoT Core, there is a fairly simple way to do what you want. Use IoT Events to send the data directly to Timestream, and query they measures from there.

You don't need to do your own trigonometry as the other answer suggested. Take this MQTT message, for example:

SandyPoint/Distillation/P-101
{
  "timestamp": 1692337059,
  "ts": "2023-07-18-1692337059638",
  "ts_dt": "2023-07-18",
  "ts_tm": "2023-07-18 05:37:39",
  "id": 8675870,
  "process": "f3c080ebe3e9cffe",
  "deviceID": "a959ed7e2d3486cd",
  "equipID": "P-101",
  "temp_f": 90.96802396406997,
  "psi_suc": 14.739556249140529,
  "psi": 187.99425090417242,
  "psi_dis": 197.21189356902917,
  "flow": 1587.7548017813767,
  "rpm": 898,
  "power": 241,
  "lube_oil": 5.00478680058105,
  "city": "Pasadena",
  "countryCode": "US",
  "zip": "77507",
  "lat": 29.599055,
  "lon": -95.015881,
  "region": "TX"
}

Because it has lat and lon values, if you know the sending CRS (in this case [WGS84]https://epsg.io/4326), you can quickly access large volumes of data. You mentioned multiple updates per minute - you could easily support hundreds of thousands of devices on AWS.

Once the data is in Timestream, you can use that as a data source for analytics and visualization tools like Grafana. My environment returns the last 10,000 coordinates in a few seconds, and can be scheduled for faster results.

Adrian Mole
  • 49,934
  • 160
  • 51
  • 83