Right now there is no way to download instance’s data without hacking around with Docker’s APIs. There is a need for a new API to download(export) and upload(import) data of stateful services like databases.
There are many motivation behind this but this is specially needed to prevent data loss by scheduling regular backups.
My suggestion is to add new funcs to Instance API to download and upload data to/from specific directory inside data volume.
Services like service-mongodb should support creation of multiple databases because a service might be used by multiple users in the network. All users should have access to their own databases by providing a secret that genered during the creation of database. This behaviour should be supported by “good quality” services.
This is why it’s important to have the ability to download a sub directly inside a data volume. Because a user only should be able to download its own database data from the filesystem.
Instance.DownloadBackup(instanceHash, directoryName) Instance.UploadBackup(instanceHash, directoryName)
directoryName actually the “secret” of user.
- if directoryName is:
DownloadBackup() will download from a path like this:
An another option would be directly uploading backups to IPFS with encryption or enabling layered data synchronisations to a cloud storage service.