简体   繁体   中英

mysql managing historical data

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

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 (eg 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM