I’m a bit fed up with how influxdb is hard to migrate. I’m running v2 on a extra server. I wanted to move it but for some reason export→import doesn’t work. This is the first time and last time I just wrote a script to export all data and then insert it via API. Took too long.
So I wanted to move all my data to PostgreSQL. That way I can use ‘normal’ tools and SQL clienst which are a bit more housemember proof here also.
But, is it smart to use PostgreSQL for storing all the data that is now sent to influxdb? I’m logging every change in a lot of stuff (some is really every second).
Anyone did the same or didn’t do the same and why not?
PostgreSQL is more than up for the job, even at those data rates, assuming the hardware is up for it. If it’s the same hardware that was running Influxdb and that was able to keep up I wouldn’t be concerned.
I might consider diversifying a bit though. Do you really need to store every change of item for all time? Probably not.
Some items probably only need restoreOnStartup. Use MapDB for that. I highly recommend using MapDB for restireOnStartup as it’s imbedded. You’ll never have issues with OH starting up before the database.
Some items only need precise data for a few days or a month. Use rrd4j for that.
That leaves a fraction of your Items left to save in PostgreSQL. Once you’ve narrowed the list down you won’t be close to overwhelming PG. And your maintenance work will be less since you won’t have to clean up the db periodically as it grows in size.
But for now I want to have ‘everything’ ™ so that I can select/decide what is useful or not.
I already looked into MapDB and rrd4j. And I still need to study them a bit better to set them up. That is also part of my quest. I know PostgreSQL and as long as I am studying the others I just don’t want to lose any data.
I just wanted to check if other people used this setup or not
There really isn’t anything to set up. Install the add-on and configure the persistence strategies same as for any presence config. There is nothing external needed.