Documentation / Under the hood

The Data Vault model and the loader

Hubs, satellites, links; how a resource is loaded.

Each FHIR® resource type has a hub (one row per business key: server, type, id; the hash key is md5 of those), a satellite (one row per version, with the resource JSON, a hashdiff, load start and end dates) and, for references, link tables with their own satellites. The current version is the satellite row with an empty end date.

Loading

  1. The incoming resource JSON is hashed (hashdiff). If the hashdiff equals the open satellite row, nothing is written (delta detection).
  2. Otherwise the open row gets an end date and a new row is inserted.
  3. References inside the resource are extracted and written as link rows (one per reference element), with stubs created in the target hub for targets not yet loaded – these are the "hub without current version" figures in the Profiler.

Updates never overwrite; history stays available, which is why the Viewer can show versions.

In the background

The golden vault is loaded with a batch loader (load_fhir_resources taking a JSON array): one round trip and one transaction per 400 resources, temp tables instead of row-by-row procedure calls, references parsed by the application, asynchronous commit. It writes the same rows as the single-resource loader at ten to twenty-five times the speed.