Advice Needed for Setting Up MongoDB for IoT Time Series Data

Hello MongoDB Community,

I’m reaching out for some guidance on a project I’m currently working on. As a frontend developer with limited database experience, I’m hoping to gain insights from the more seasoned members of this community.

Project Overview:

  • Purpose: Setting up a database for time series data from IoT devices.
  • Scale: Approximately 5,000 devices, potentially more.
  • Data Collection: Devices will measure temperature every 10 minutes. However, to avoid overburdening the devices, temperature data will be sent to the server every 6 hours (four times a day). This means batching temperature readings and adding them using insertMany.
  • Volume: This approach will result in about 262,800,000 measurements per year, amounting to over 1GB of data annually.
  • Retention: Data needs to be stored for three years.

Questions:

  1. MongoDB Suitability: Is MongoDB a good choice for this type of application, considering the data volume and frequency?
  2. Data Organization: Would it be better to store all data in a single time series collection, or should I create a separate time series collection for each device?
  3. Backups: What would be the best approach for creating backups for such a large amount of data?
  4. Granularity: How should I set the granularity for data that will arrive at random intervals? I’m struggling to understand from the documentation whether granularity is more about data writing or if it’s used primarily for creating efficient queries.
  5. MongoDB Atlas Plan: Given the specifics of my project, which MongoDB Atlas plan would be the most suitable?
  6. Server-Side Programming Language: My natural choice for writing the server is Node.js, but I’m concerned about its single-threaded nature. Could this be a problem with the scale and nature of my project? Are there better alternatives?

I’m eager to learn and ensure that I’m setting up everything as efficiently and effectively as possible. Any insights, tips, or resources you could share would be incredibly helpful.

Thank you in advance for your time and assistance!

Best regards,
Mateusz