I’ve been working with ESP32 microcontrollers to collect temperature and humidity measurements for my home monitoring project. Right now I’m stuck on the data storage part and not sure what direction to take.
I came across a tutorial where someone sent their sensor readings to a web server that stored everything in a MySQL database hosted online. It looked pretty impressive but I’m wondering if that’s way too complicated for what I’m trying to do at home.
What are you folks using for this kind of thing? Are databases like MySQL or PostgreSQL worth setting up for sensor data, or should I keep it simple with local text files or maybe try something like InfluxDB with Grafana dashboards?
I’m pretty new to this whole setup so I’d really appreciate hearing about what actually works in practice rather than just theoretical solutions.
Honestly, just use ThingSpeak or Adafruit IO to start - way easier than setting up your own database server. I’ve been pushing ESP32 data there for months and it’s super reliable. You can always migrate to something more complex later, but these cloud services handle all the backend stuff so you don’t have to worry about server maintenance or anything breaking.
For ESP32 sensor projects, I recommend starting with SQLite locally before considering more complex solutions. I’ve been using it to monitor temperature for two years, and it has managed millions of readings without any issues. There is no server maintenance required, and it performs well on devices like Raspberry Pi. InfluxDB is a great option if you’re focusing on time-series data and want advanced analytics, but there is a steeper learning curve. I transitioned to InfluxDB after outgrowing SQLite, and the performance benefits for long-term queries are significant. Text files can complicate things—my initial experience with them proved to be a challenge for data analysis and graphing. Using a database from the start can save you a lot of trouble down the line, especially for tracking averages or trends.
Had this same problem last year with my greenhouse sensors. Started with CSV files - what a mess when I tried analyzing trends or making graphs. Ended up using Node-RED with a local PostgreSQL database on an old laptop. Took about half a day to set up, and now I can query historical data or export whatever I need. PostgreSQL sounds scary but it’s actually pretty simple for sensor logging - just make a table with timestamp, temp, and humidity columns. The indexing makes time-based queries super fast compared to digging through text files. Weekly and monthly reports are a breeze now. If you know basic SQL, definitely go this route instead of limiting yourself with basic storage options.
I did this exact same thing six months ago for my indoor air quality setup. Went with InfluxDB on a Raspberry Pi 4 - it’s been rock solid ever since. The big win is that InfluxDB is built specifically for time-series data like sensor readings. The retention policies are amazing - it’ll automatically downsample old data to save space while keeping recent stuff at full resolution. Setup was way easier than I expected, and the web interface lets you run quick queries without extra tools. Wish I’d known earlier that InfluxDB has great ESP32 libraries that make posting data dead simple. My ESP32s just HTTP post every few minutes and I’ve never lost data. The query language takes about an hour to pick up, but once you do, pulling time ranges or calculating averages is cake.
MQTT broker + Home Assistant is perfect for this. My ESP32 sends readings every 30 seconds, and HA automatically stores everything in sqlite. Setup’s super simple and you get great dashboards right away. Mine’s been rock solid for 8 months.