0

I have a mysql database that contains three pieces of data; time date stamp, temperature and location of sensor. Every day I would like to maintain the data and only keep historical low,high and average temperature in my database from the past. What functionality within mysql should I be looking at to do this?

Thanks

Vikash Pandey
  • 5,407
  • 6
  • 41
  • 42
silver
  • 1

1 Answers1

0

To make this work I would advise you to use MySQL scheduler and trigger a stored procedure that would either:

  1. clean up your table and leave only the low,high and average values;

    OR

  2. move all relevant data (e.g. low,high and average values) to annother table which would then hold only that "relevant" data.

One other thing: MySQL maybe isn't the best option for storing sensor data. A NoSQL solution like Cassandra should be a better suited solution.

Maybe this could help You regarding that.

http://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis

Community
  • 1
  • 1
Traveller
  • 399
  • 2
  • 20
  • moving to another table was a thought which I didnt pursue. Might venture down that road. I will look into nosql also – silver Sep 25 '15 at 14:03