-
-
Notifications
You must be signed in to change notification settings - Fork 343
Investigate adding a built-in data backup solution #10690
Description
Is your feature request related to a problem? Please describe.
We've had multiple production instances facing data loss due to disk failures, database corruption of unknown sources, where these instances either did not have backups set up or the backups were unusable.
Describe the solution you'd like
I'm proposing we investigate a built-in backup solution.
This should not be considered a full backup solution, but rather an opt-out setup where critical data is saved in a secondary location. Think first-aid-kit vs hospital or fire extinguisher vs fire brigade.
My initial thoughts would be to have a sidecar container that has access to two data volumes, one of them being the CouchDb data volume and the other being the secondary storage. Depending on the instance setup, this provides more or less safety.
This container would save the CouchDb `medic data shards to the separate location. This will exclude indexes and secondary databases (however, we would maybe choose to include the _users database as well). Saving would happen daily (? or be configurable through an env parameter for example).
The solution should also include scripts to restore data easily.
The solution should be e2e tested in our CI suite.
Describe alternatives you've considered
@jkuester suggested we somehow add the action to create the backups in cht-conf.
@mrjones-plip suggested to display a nudge to backup in the Admin app.
Other suggestions were to have an external service that does backup.
Considerations: backups may need to be sent to different vm’s, disks, data centers.
Happy to hear thoughts!