Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Backup #8

Open
alexanderkiel opened this issue Sep 23, 2020 · 0 comments
Open

Implement Backup #8

alexanderkiel opened this issue Sep 23, 2020 · 0 comments

Comments

@alexanderkiel
Copy link
Member

The idea doesn't work, because referential integrity will most likely violated on restore. But I'll leave this here for possible improvements.

The idea is to implement a simple backup using the system history interaction.

Full Backup

A full backup can be obtained by paging through the whole output of the system history interaction. Such paging should be stable on a FHIR server. So no versions should be missing or duplicate.

Incremental Backups

After the first download of all versions, incremental backups are possible using the _since query parameter. The last seen versions timestamp can be obtained through response.lastModified.

Full Restore without History

The history bundles can be processed from the most recent to the least recent. For each entry:

  • the combination of resourceType and id will be looked up in a table
  • if the resource was already processed or the request is a DELETE, the entry will be skipped
  • if the request is a POST or PUT, the entry will be appended to a transaction bundle

Transaction bundles are then POST'ed to the server to restore. The result would be that all resources are restored but without any history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant