Partitioning Outcomes

Partitioning is designed so that it can be used to achieve different outcomes.

Multitenancy

Partitioning could be used to achieve multitenancy, where there are multiple logically separate resources on the server. Traditionally this kind of setup is called tenant wise, and each of these tenants should not be able to access or modify data belonging to another tenant.

Separate Data

Partitioning could also be used to logically separate data coming from distinct sources within an organization. For example, patient records might be placed in one partition, lab data sourced from a lab system might be placed in a second partition and patient surveys from a survey app might be placed in another. In this situation, data does not need to be completely segregated (Lab Observation records may have references to Patient records in the patient partition) but these partitions might be used to support security groups, retention policies, etc.

Partitioning in HDR FHIR JPA means that every resource has a partition identity. This identity consists of the following attributes:

  • Partition Name: This is a short textual identifier for the partition that the resource belongs to. This might be a customer ID, a description of the type of data in the partition, or something else.
  • Partition ID: This is an integer ID that corresponds 1:1 with the partition Name. It is used in the database as the partition identifier.
  • Partition Date: This is an additional partition discriminator that can be used to implement partitioning strategies using a date axis.

At the database level, partitioning involves the use of two dedicated columns to many tables within the HDR_FHIR Schema

PARTITION_ID – This is an integer indicating the specific partition that a given resource is placed in. This column can also be NULL, meaning that the given resource is in the Default Partition.

PARTITION_DATE – This is a date/time column that can be assigned an arbitrary value depending on your use case.

When partitioning is used, these two columns will be populated with the same value for a given resource on all resource-specific tables (this includes HFJ_RESOURCE and all tables that have a foreign key relationship to it including HFJ_RES_VER, HFJ_RESLINK, HFJ_SPIDX_*, extended tables like OHF_FHIR_*etc.)

When a new resource is created, the partition ID and date is assigned to the resource.

When a resource is updated, the partition ID and date from the previous version is used.