1

Ok. Just a scenario.

I got about 100 smart homes. Every smart home has a different amount of door sensors, temperature sensors, humidity sensors. Every house could add or remove some of them. For this example every temp & hum sensor uploads every 10 minutes (asynchron) their current value (via MQTT) to a server (144 Values/per day/per sensor). And all door sensors upload their state (open, closed) everytime the state changes.

In my study I just got a little insight in relational database (MySQL) and I think that is the wrong model for my purpose (but I have nearly forget everything). So could you just give me tip like:

"Search for "relational Database". "MySQL". This works fine for your case because..."

I want a database where i could add a smart home: with informations like city, street, inhabitant,.... And to this smart home I add sensors like (temp1, temp2, temp3, temp4, door1, door2, hum1). Important: I want to be able to add and remove sensors. and for every Sensor I want the data stored like this:

temp1
Date                   Temperature    
01.01.2016 09:42       22.2°C
01.01.2016 09:52       21.2°C
01.01.2016 10:02       21.5°C
01.01.2016 10:42       21.7°C
01.01.2016 10:42       21.9°C
01.01.2016 10:42       21.8°C
01.01.2016 10:42       22.1°C

is this a object-orient-database?

Would it be possible to get the History of the last seven days from smarthome45.door7

greetings from germany

Edit:

"Unclear. What is your question ? Please edit." – kebs I don't have much experience in databases. I read some summarys of the different database models but I still don't know, which of them would fit for my project. So I just hoped, that someone who has some experience in databases could give me some advices. Because for me it looks like I have a database in a database.

Edmundo Del Gusto
  • 378
  • 1
  • 4
  • 15
  • Unclear. What is your question ? Please edit. – kebs Jan 25 '16 at 16:44
  • Have you looked at time series databases? Your primary data is sensor observations and a fairly standartized model (home with some metadata). Sensor data is time series so you might want to optimize for that not only in terms of storage but also in terms of analytics that you can built on top of this data. – Sergei Rodionov Jan 26 '16 at 08:29
  • From the sounds of things, any half way decent relational database (MySQL, MS-SQL, Oracle, whatever) would be able to handle your requirements easily with standard tables. Designing an entire database/giving general advice on what is best for a project is a little broad for Stack Overflow though. – James Thorpe Jan 26 '16 at 09:32

1 Answers1

0

Depending on your question any relational database (XXX SQL) would work. You must design database to handle your time based data.

Mert Gülsoy
  • 2,779
  • 1
  • 19
  • 23