If you want to keep your actual data for a year you will want to use something other than rrd4j. That persistence has the advantage of keeping your database at a fixed size but it does so by “compressing” data as it gets older. I put “compressing” in quotes because what it actually does is throw out data. For example, month old data may go from one value a minute to one value an hour, year old data may go from one value an hour to one value a day, etc.
Do you want to access this data from outside of openHAB? That can also impact your selection as servers like MySQL are more universally supported than db4o, for example.
So, if you don’t care if you keep all of the data as it gets older I would probably go with rrd4j as you will never have to worry about your database getting too large (this is what I use). If you don’t care about accessing the data from outside of openHAB I would probably go with db4o as it is light-weight and doesn’t require setting up and configuring a separate service. If you do want access to it outside of openHAB I would go with either MySQL or InfluxDB.
well, one value per day is absolutely fine. i am planning on doing the following:
i will count the ticks in a Number item “usage_now”.
a rule that triggers every day at 23:59 will then write that value to a second persisted number item “usage_day”.
so i guess 365 values for “usage_day” should fit inside a rrd4j database?
i already have rrd4j set up (for temperatures) so i just have to add “usage_now” and “usage_day” to it.
still i need to persist every minute, even if the value for “usage_day” is written only once a day?
Unfortunately yes. rrd4j does strange things if you don’t use an everyMinute strategy including failure to generate charts (they come up blank) and providing nulls when trying to use past values in your rules.
But since the DB is a fixed size I think it is a fair tradeoff to never have to worry about doing a purge sometime in the future because my DB ate my hard disk.