I recently bought many sensor to use with my pi, using the GPIO. All the scripts to retrieve data are ready, but now, I would like to store it in a database, and then thanks to an API, use it to display graphs, trigger alerts on a website hosted on github. The project is to build my own IoT plateform.

My question is the following one, regarding the needs of the project, what kind of database would you advise me ? I thought about the base SQL or SQLite, but I would like to do something more recent maybe, like noSQL, or Node.js. If anyone has ideas about that and advise, please feel free to answer !

  • 1
    Not a suitable question for this site. You need to research the pros and cons yourself. – joan Jun 7 '18 at 10:08
  • This question isn't related to raspberry pi.. Try to ask in the stackoverflow community. – Katte Jun 7 '18 at 10:46
  • The pros/cons of this issue are maddening to research and I'm glad to offer what I gleaned. – OyaMist Jun 7 '18 at 13:37
  • @Katte StackOverflow did not help me when I was researching. – OyaMist Jun 7 '18 at 13:38
  • @TomFrench your question is uncomfortably broad and not easily answered succinctly. We can probably work on it together to make it more useful to the site in general – OyaMist Jun 7 '18 at 13:40

NOTE: This question is dangerously close to being an opinion question, which is more appropriate for Reddit. But I've tried to cast this answer as a "here's a working example". And you yourself have found another.

Having recently asked myself the same question for the same reason I will share what I know. I use NodeJs because Javascript is common to front/back end. I use SQLLite because it's free and SQL hasn't changed in decades. You can poke around my repo (https://github.com/oyamist) for ideas. It handles I2C, W1 etc. The downside of using OyaMist is that most hobbyists use Python and products such as HomeAutomation. I wanted something more robust.

Your question is broad, so the answer will be as well:

Web: NodeJS with express.js is great because Javascript can be used as a single language for front/back end. Vue or React are good choices for front-end. I use Vue.

Database: SQL is good for working with time series that sensors collect. I chose SQLLite3. SQL hasn't changed in decades.

SensorSoftware: The choice of Javascript points to rpio although Python libraries are more common.

  • I found a very interesting tutorial using express Js, and mongoDB, here's the link : webapplog.com/… – Tom French Jun 7 '18 at 13:48
  • OyaMist uses express. MongoDB is a hash database. SQL is qood for time series, which sensors collect. I would consider MongoDB for tracking plants for example, but if you have SQL anyhow, just use that. – OyaMist Jun 7 '18 at 13:54
  • note to moderators: I have tried to eliminate the opinion basis by turning the question into a how question. My example is factual. Others exist as found by the OP. The question actually relates to "how to think about a prolbem" Hopefully i've addressed that. – OyaMist Jun 7 '18 at 14:34

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