Backup only postgres

There is an idea for automatic recovery of session keys from devices from postgres.
Now if we lose data from redis, then we will have to re-roll all devices or wait until they are reactivated themselves, if such an algorithm is implemented on them.
If you automatically restore keys from postgres, then only it will need to be backed up, and not two databases
Of course, we will lose statistics data, but it’s not as bad as losing session keys. Although it is possible to obtain statistics data from postgres if necessary and add them to redis

That seems like a lot more work (and potentially prone to failure) than just backing up your Redis.

https://redis.io/topics/persistence

Device keys and other data are already stored in database chirpstack_ns in table device_activation.
Why backup the same thing twice?

I recommend backing up all production data stores, as a matter of best practice if nothing else. The Redis data will be small and pretty quick to move around.

1 Like

As @bconway suggests, it is better to backup both databases regularly. However, this has been brought up a few times. One option which potentially could work is persisting the device-session every X uplinks in PostgreSQL. That way, it would not put too much pressure on PostgreSQL, but you have a recovery option in the worst-case scenario.

I’m currently working on a refactor and cleanup (nothing public yet). Once that is stable, I would consider looking into such feature.

4 Likes