4

Assume I build a IoT gateway (Linux OS) for collecting data from sensors. Data is store on database, and can be viewed via a web server implement on this gateway. Storage is not much, about 2GB. Which database is a good choice for this situation? RDBM or NoSQL or Time series? In my positon, I think no need both NoSQL and Time series, just going on with traditional RDBM. Is it good? Please give me some advices.

Add more info:

  • Each sensor will send temperature, voltage, etc.
  • Data visualization for each sensor in one hour, one day or one month. (I think it is good for the max period is in one month)
  • And track all every single value. Example: gateway want to read data from a sensor in a moment, but it could not get for some reasons (sensor is die, disconnect to network, etc). So, this moment will be track and set it's value to null (or a value point out that could not get data from sensor in that moment). When you view data visualization, you will know in that time, it was a problem with sensor or network.
1
  • 2
    You need to add a lot more information to the question. Mainly about what the data will actually be used for. e.g. do you actually need all the data or will a aggregate summary do for historical data.
    – hardillb
    Aug 24, 2019 at 5:48

2 Answers 2

2

It doesn't sound like you will have much data so I would go with whatever you are most comfortable. If you are proficient with SQL, I would use a SQL database such as MySQL or Postgres.

Once you get into higher volume, hundreds to thousands of inserts per second, then I would look into a time series database. They can handle high ingestion and provide easier query methods for wrangling with the data.

I wrote a blog post about how to query a regular database vs a time series database (Hyprcubd). https://blog.hyprcubd.com/time-series-graph/

1

If I am understanding correctly you are saying Time-series database like this one right?

enter image description here

Then you should go with the Time series database as you said:

Data visualization for each sensor in one hour, one day or one month. (I think it is good for the max period is in one month)

And also:

Each sensor will send temperature, voltage, etc.

So the best option is to view the data on the graph with the view of every 5-10min, an hour, a day or a month. As shown in the above example image.

If as you said:

And track all every single value. Example: gateway want to read data from a sensor in a moment, but it could not get for some reasons (sensor dies, disconnect to network, etc). So, this moment will be track and set it's value to null (or a value point out that could not get data from the sensor at that moment). When you view data visualization, you will know at that time, it was a problem with sensor or network.

when the sensor dies the plot on the graph will be "null=0" showed with the time and date reference.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.