0

I have a SQL DB which contains PHI, hosted on AWS. I want to access this data to perform analytics, however, I must de-identify the data first to comply with HIPAA.

How should I approach this? I have thought of a few approaches:

  1. Simply de-identify the DB with SQL commands.
  2. From now on, every time the DB is added to, add a de-identified version of that data to another DB. Then access this DB for analytics.
  3. From now on, every time the DB is added to, add a de-identified version of that data to another table in that DB. Then access this table with SQL commands for analytics.

Which is the best approach to use to maintain compliance with HIPAA? Or, is there a better way?

Thanks!

5
  • You might consider writing a de-identified version of the data into a new S3 bucket, secure access to that bucket, and consider performing queries/analytics through Athena. If the data is correctly de-identified then my understanding is that it is no longer considered PHI.
    – jarmod
    Jul 14, 2020 at 18:15
  • @jarmod You are correct that it is no longer PHI if de-identified. So, just to confirm, can I store my postgres db in an S3 bucket? Also, what does Athena do? As you can likely tell, I am new to this stuff ;). Thank you !!
    – user13514973
    Jul 14, 2020 at 18:30
  • Your preferred solution is going to depend a lot on what type of clients you have and what their access patterns are. I wouldn't store the PostgreSQL DB itself in S3, just the individual records as JSON (or CSV or Parquet). Then you can point Athena at the S3 bucket, have it infer the schema, and then provide SQL query capabilities. You can then connect any standard ODBC/JDBC compliant client to Athena.
    – jarmod
    Jul 14, 2020 at 19:24
  • @jarmod Thank you for this response. This makes sense, but one last thing I was wondering: when should I write the data to S3? Should I do it as it comes in live? Perhaps weekly? Or on command with a script? Also, to de-identify the data, is using SQL commands ok?
    – user11141180
    Jul 14, 2020 at 19:45
  • 1
    As @petern indicated, one option is Database Migration Service. You'll need to understand the pricing model there to know if it makes sense to do continuous, ongoing replication. Or leverage some common PostgreSQL CDC process.
    – jarmod
    Jul 14, 2020 at 22:48

1 Answer 1

2

Budget allowing, consider doing your analytics on a different system and during the ETL, de-identify the data. Changing the source system to accommodate this requirement will increase complexity to maintain and likely affect other integrations - might end up with a monolith.

There's various ways to do this: You could do a AWS DMS (with ongoing replication) with the DB as your source and S3 as target (parquet format). From there you could use Athena for analytics as jarmod highlighted, which also supports parquet format and you can even use SQL-like queries in Athena to analyze your data. There's also Redshift, send to another Relational DB, other analytics platforms etc.

6
  • Thank you for this answer. This makes sense. One question I have is how can I automatically de-identify and write the data to s3 when it is uploaded to RDS? Thanks!!
    – user11141180
    Jul 14, 2020 at 19:50
  • Your best friend here will be transformation rules with DMS. You can entirely remove columns from tables/views before pushing to target. For instance, in a Contact table you can choose to just push out the zip code, or remove names from a Person table. You may still need Ids for averages and the like. I now see they've added expressions. Read more here: docs.aws.amazon.com/dms/latest/userguide/…
    – peter n
    Jul 14, 2020 at 21:01
  • This makes sense. And just to confirm, do you think it would be best to make it write to S3 as soon as something is added to the original DB, or do it at a set interval? What is the default with DMS? Does this make sense?
    – user11141180
    Jul 14, 2020 at 21:28
  • Good question. The only option that I've worked with of is CDC - continuous replication. You could possibly "pause" the task and have a schedule that resumes it, don't quite see the benefits of doing that. Unless it's feasible to blow up the S3 data and replicate again, say every week.
    – peter n
    Jul 14, 2020 at 21:47
  • So, does this mean you would recommend doing it live? Meaning, as data is coming into the one DB, it automatically de-identifies it and writes to S3?
    – user11141180
    Jul 14, 2020 at 21:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.