MegaScale
MegaScale is a mechanism for storing virtually unlimited amounts of data in a single FHIR server. It uses multiple database instances to create discrete pools of data which are logically separate, but are managed under a single Smile CDR FHIR Storage (RDBMS) module.
In its simplest terms, a MegaScale-enabled server can be thought of as a multitenant repository where each tenant is hosted in a separate database instance.
Using this strategy can be helpful in cases such as:
In MegaScale mode, one or more FHIR Endpoint modules are combined with a single FHIR Storage (RDBMS) module. Incoming FHIR requests include a tenant identifier which maps to a particular partition, which then specifies the target database. This architecture is shown in the diagram below.
This section lists the known limitations on this feature.
The following FHIR interactions have been tested:
No other features, operations, or interactions have been tested or are expected to work with MegaScale.
If Cross-Partition References are enabled, it will be possible to create references that cross partition and database boundaries. In a MegaScale-enabled repository, these references rely on a soft-reference that is stored in the source partition that redirects the server to the target partition.
These references may be used for _include
processing, but do not support chained searches or _revinclude
processing.
To enable MegaScale mode, the following settings must be set.
On the FHIR Storage (RDBMS) module:
true
.REQUEST_TENANT
.true
.On the FHIR Endpoint module:
URL_BASED
.MegaScale connection details are supplied using a Java Smile CDR Interceptor using the STORAGE_MEGASCALE_PROVIDE_DB_INFO
pointcut.
See Example: MegaScale Connection Provider to see how this pointcut can be used. This example is also available in the Interceptor Starter Project.