A deep dive into building a patient-scoped FHIR cache on object storage.
1. The problem: one database, one shape of read
Our fhir resource store holds the FHIR resources that everything else in the product reads. It sits on a single Postgres database that is the largest + most expensive one we operate.
The dominant load is patient-scoped : "give me every Condition for patient X," "every Observation for patient X between these dates." Our recommendation engine's heaviest pipeline runs this pattern thousands of times every week. Each run pulls a patient's full clinical history.
That workload was already straining the database at our current member count.…