plan: blob store backups - #809
Closed
dannash100 wants to merge 1 commit into
Closed
dannash100 wants to merge 1 commit into
dannash100 wants to merge 1 commit into
Conversation
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tamanu is moving attachment and asset bytes out of the database into a content-addressed blob store on disk. Once it does, a
tamanu-postgresbackup stops capturing a server's whole state: the database holds the references, the store holds the bytes, and the two have to be backed up and restored consistently.The behaviour is specified Tamanu-side (
specs/blob-storage/backups.md, idBKUP, in the blob store epic). This is the brief for our end, added as a plan rather than folded intoBAKbecause two of its requirements have no mechanism here yet and the design isn't settled. Options are laid out, nothing is chosen.The two gaps:
BackupDefhas no dependency field and Canopy emits due types with no declared order, so there's no way to express it. Three options in the plan, the honest one being a definition-level ordering field that Canopy respects.Two things that make this easier than it sounds: the store needs no freeze, since blobs are immutable and land by atomic rename, so
simpleis correct against a live store; and each store capture represents the whole store rather than a delta, so retention can't strand a blob that's still on disk.Also flags the boundary on restore: reconciling the tree against Tamanu's own registry of what it holds is Tamanu's job, not ours, and neither side should assume the other does it.