Row Level Security
# dev
j
Thinking about sketching out how Row Level Security could be used so that PG database Roles could only see resources from certain Projects Use case here is that we have some data that our customers have given us permission to review for analytics / debugging purposes, but it's entirely opt-in. For other customers, we've made warrants that we will not access data whatsoever. Right now, we do queries by wrapping the SQL in some Project ID rules (ie we always inject a
WHERE projectId is in (...)
clause. RLS could really make this stronger though, and would let us use other tooling. We need to do this work at the DB level because the queries are pretty analytical, they can't be mapped to the FHIR API and otherwise doing the processing on individual resources would take ~2 orders of magnitude longer. We could also start transporting data somewhere else, but less is more IMO. Is there any existing effort to look at how RLS might be used?
r
HI @joshua_kelly - this isn't something we're looking at right now. For the most part, the DB schema is an implementation detail for most of ours.
When they do analytical queries, they typically use the Bulk export APIs to sync to a proper data warehouse like snowflake or BigQuery
167 Views