Requested by Scott
The Logica implementation of multitenancy is through use of a separate schema for each partition. All fhir queries contain the tenant id in the url. Whenever a database connection is needed to be borrowed, the function call contains a tenant id. The database connection that is lent out, contains a reference to a connection pool that contains the schema to use for the particular tenant. This is how the tenant data is kept separate.
The hapi implementation of Multitenancy is through use of a a partition id in the database that is stored in a column. All tables that store resources will contain a partition id and that is how multitenancy is achieved. fhir queries can contain the partition id in the request or in the request header. The hapi multitenancy implementation has some limitations.
Attached a document that describes the Multitenancy implementation in the sandbox.