LinuxForHealth / FHIR

The LinuxForHealth FHIR® Server and related projects
https://linuxforhealth.github.io/FHIR
Apache License 2.0
330 stars 157 forks source link

Ensure offload datastore and RDBMS are tied together #3491

Open punktilious opened 2 years ago

punktilious commented 2 years ago

Is your feature request related to a problem? Please describe. When using blob offload (e.g. Azure Blob) to store payloads, administrators must be extremely careful not to change the container or database used for a given tenant. If one service is changed without the other, data corruption will occur impacting the integrity of the tenant.

Describe the solution you'd like Provide a metadata mechanism to establish a logical connection between the RDBMS and offload stores. This can be checked as part of a healthcheck operation or the first time a load/store operation is performed.

Describe alternatives you've considered Leave as-is and accept the risk of a configuration issue causing data problems.

Acceptance Criteria

  1. GIVEN [a precondition] AND [another precondition] WHEN [test step] AND [test step] THEN [verification step] AND [verification step]

Additional context Add any other context or screenshots about the feature request here.

punktilious commented 2 years ago

One thought is to simply write a UUID value to both the RDBMS and blob container. As long as this value matches, the two services can be considered connected. Another simple solution would be to use a random value which acts as a salt to a SHA-256 hash of the tenant name and store both values in both services. This would provide further protection that each service is meant for the configured tenant.

lmsurpre commented 2 years ago

maybe do at the same time as #3914 ?