I built a little setup with a raspberry pi and a temperature and humidity sensor. Every 5 minutes it reads sensor values and sends them both + a timestamp and a custom ID (there are multiple pis, each with its own ID) to a nodejs API which then stores them in a single mongodb collection. A GET
request to this API then returns all objects from the collection with the id provided via GET
.
Here is a json sample object of the data structure from my collection:
{
"_id": "5c935a046b4fcc27f2a81cd8",
"id": "livingroom",
"time": "2019-03-21 10:31:48.601374",
"temp": "22.0",
"hum": "46.0"
}
Im pretty new to mongodb and databases in general but my programming experience tells me that just dumping everything into a single collection is not a good way to handle my data (propably, I really don't know).
So my question is: Are there any big gotchas of me handling my data like this or am I fine for this projects scope? Do I need to expect big performance hits if this collection gets too big?