2
votes

I need to implement a system for storing timestamped sensor data from several devices on an embedded platform. According to this related question, a relational database is the preferred solution for storing that kind of data and I have therefore been looking at SQLLite.

However, I also need the database to be able to answer questions such as "What was the indoor temperature on Sep 12 at 13:15", even if the sensor data was not recorded precisely at that time. In other words, I need the database to be able to handle interpolation. As far as I could tell, SQLite cannot handle this, nor can the usual suspects (MySQL, PostgreSQL).

In addition, I would also need the database to be able to detect gaps in the data.

This related question seems to deal with mainframe-ish databases and not with embedded ones.

Therefore: Is there a database system suitable for embedded platforms that supports the "usual" operations one might want to perform on time-series data?

2

2 Answers

1
votes

You shouldn't want or expect a database to do interpolation for you. Just pull out the nearest values to your desired time, and write your own interpolation. Only you would know what the appropriate type of interpolation should be used. Maybe simple linear across two points, maybe higher order polynomial across more points. It really depends on your system and data modeling situation.

1
votes

Specialized time series databases.

Try:

  • RRDTool (simple utility, may be sufficient for you)
  • OpenTSDB
  • InfluxDB

Given your use case, may also be relevant to take a totally different approach, using an "IoT" targeted data store optimized for simple inserts (Xively, Phant.io) and then post-process for time series analysis.