Skip to main content

Health Data, Delivered: How DLT Powers the HealthVerity Marketplace

Summary

  • Scalable ETL Framework: Build scalable, reliable ETL pipelines using Theseus, a custom framework that leverages Databricks-native capabilities including DLT, auto loader, and event-driven orchestration.
  • Data Quality and Governance: Implement structured bronze, silver, and gold layer architecture that ensures high-performance, fault-tolerant data processing with minimal operational overhead across the Databricks Data and AI platform.
  • Cost-Efficient Pipelines: Reduce engineering effort and accelerate time-to-value by using a declarative framework that automates complex data workflows and improves data quality while optimizing costs.

Health Data, Delivered: How DLT Powers the HealthVerity Marketplace

Watch: Health Data, Delivered: How DLT Powers the HealthVerity Marketplace
Talk by Ron DeFreitas, Principal Data Engineer, HealthVerity
Building scalable, reliable ETL pipelines is a challenge for organizations managing large, diverse data sources. Theseus, our custom ETL framework, streamlines data ingestion and transformation by fully leveraging Databricks-native capabilities, including DLT, auto loader and event-driven orchestration. By decoupling supplier logic and implementing structured bronze, silver, and gold layers, Theseus ensures high-performance, fault-tolerant data processing with minimal operational overhead. The result? Faster time-to-value, simplified governance and improved data quality — all within a declarative framework that reduces engineering effort. In this video, we’ll explore how Theseus automates complex data workflows, optimizes cost efficiency and enhances scalability, showcasing how Databricks-native tools drive real business outcomes.
Here’s more to explore:
Production ready data pipelines for analytics and AI: https://www.databricks.com/solutions/data-engineering
The Big Book of Data Engineering: https://www.databricks.com/resources/ebook/big-book-data-engineering-2nd-edition
See all the product announcements from Data + AI Summit: https://www.databricks.com/events/dataaisummit-2025-announcements

FAQs

What is the Theseus framework?

According to this video, Theseus is a custom ETL framework built on the Databricks Data and AI platform that streamlines data ingestion and transformation by leveraging DLT, auto loader, and event-driven orchestration.

How does HealthVerity manage such large data volumes?

HealthVerity uses the Databricks Data and AI platform to manage over 30 petabytes of healthcare data, migrating from a legacy Hive warehouse to leverage DLT and modern data engineering practices for reliability and scale.

What are the key benefits of the Theseus approach?

This video highlights faster time-to-value, simplified governance, improved data quality, reduced engineering effort, and optimized cost efficiency through decoupled supplier logic and structured layered architecture.

How does the bronze-silver-gold layer approach work?

The layered architecture in this video ensures high-performance, fault-tolerant data processing by organizing data from raw (bronze) through intermediate (silver) to refined (gold) layers, enabling quality control at each stage.

Full transcript

Thanks for being here. I know it's the very last day of Summit. Um those of you have been here a lot of times before really expected that you know, maybe the last of the keynotes would have been yesterday and then today would have just been wrap up and go home. So, for those of you who stuck around, I definitely appreciate it. Now, initially, I was going to, you know, start this off with some kind of joke or something, say something about hey, you know, we didn't have Jensen from Nvidia uh this year, so at least somebody had to be up on stage with a leather jacket.
Um So, this you've seen on every session you've been in, you know, basically saying there's no guarantees behind anything I say. Um I'll extend that to it's not only guarantees about Databricks, it's guarantees to what we're doing at HealthVerity that could change at any time as technology advances. So, little bit about me. Uh de Freitas. I'm principal data engineer at HealthVerity. I'm currently in charge of uh migrating over and kind of owning our data warehouse uh that houses our massive real-world data marketplace.
Okay. Uh I come from a software engineering background. I've been doing this far longer than I'm willing to admit. I've always worked as hands-on data engineer and architect. Some of the things that I really focus on and care about are clean patterns, development empowerment, um really accelerating how people work. Um and a little bit about HealthVerity uh for those of you who don't know us, um we really help organizations unlock real-world health care data so that they can get deeper insights, conduct research, improve clinical trials, um make difficult informed decisions, and we do all of that while prioritizing patient privacy and data governance.
And we've got one of the largest data marketplaces in the industry, over 30 petabytes of health care data. Um and what we do is really innovative because we're not a reseller, we actually function more of a data broker. So, we have relationships with our suppliers um to make sure that the right people are getting access to that data for the right type of research. And so, let's go into the challenge that we've had recently.
Um so, we've been working with Databricks for several years. We've built our all of our marketplace applications and data serving tooling right on top of Databricks technologies. But, like many of you, we started off with a legacy Hive warehouse. Um as you can imagine, migrating 30 petabytes of data from a legacy system to run natively on Databricks uh is a massive undertaking. We've we've struggled to get it right. So, when I joined HealthVerity a year ago, our team had already made more than one attempt to modernize our warehouse platform.
Uh the latest attempt was something called, and it was built on top of Databricks. But, it ended up being a series of tightly coupled, hand-rolled workflows managed by a bespoke external orchestrator. Um there's no standardized patterns, uh no reusable components, poorly managed environments. We didn't have a lot of visibility into what was actually going wrong. So, instead of building a platform that we could iterate on, we got one that locked us in and it slowed us down.
Right? And as you can see from the slides here, right? We we only made a couple of leaps here. We went from legacy Spark on EMR with Airflow to Databricks jobs, but with a complex bespoke orchestrator that only a couple of people knew how to knew how to run and manage. Um we got the benefit of switching from Parquet and Hive over to Delta and Unity Catalog, which was absolutely huge for us. But, we still had hundreds of SQL-based pipelines that we couldn't really categorize, couldn't really scale with.
Um we didn't have unit testing, no life quality checks. Right? We did get the advantage of Unity Catalog lineage, but because of the way the jobs were set up and the lack of standards, that lineage was basically garbage. We couldn't use it. Right? So, at the end of all of that, we've got a platform that's hard to change, hard to trust, and it didn't scale with our needs. So, it wasn't legacy versus modern. This was modern tools used in legacy ways.
And we had a lot of great people working on this. The team wasn't the problem, the approach was the problem. So, we you know, we had to make a decision. Do we spend months or years trying to fix it and still possibly not get what we needed out of it? Or do we start building a new solution piece by piece, replacing components of the system as we deprecated out those features? Hence, what we call Project Theseus was born.
So, how many of you are familiar with the thought experiment of the Ship of Theseus, right? The boat decays over time, you know, boards rot out, you replace the boards. Eventually, um none of the original parts remain. Is it still the same ship? The same thing applies to any type of software engineering, right? We build new features, we refactor, we make improvements. At the end of the day, is it still the same code?
Is it still the same product? Or has it become something different, something evolved, something better? Right? So, what we wanted to do is really empower our our data engineering teams with modern tooling and support, while still keeping the lights on for the data sources that are already migrated over to, and the data sources that were still trapped in our Hive legacy data warehouse. Right? So, so we wanted to take a modular approach.
We wanted to replace the components incrementally. We want to use conventions, not boilerplate. Uh we want to focus on best practices and then reuse whatever we can, right? We've already gone through the process of vetting the data transformations, migrating a lot of those over, and we know the business logic works. We just can't really test it, right? We can't scale it. So, what do we need to build? Right? So, we look we went back, we looked at the requirements and said, "What do we really need inside of this system?"
We need to focus on the developer experience, right? We need faster onboarding. We need to be able to bring a new supplier on in days and not weeks, right? Or even sometimes months. We want declarative logic that scales. We want our engineers writing transformations, not orchestration. Okay? We need robust and reusable quality checks, right? We need to make sure bad data does not make it through through into our warehouse.
And in health care, that's even more important, right? Because what if you have a PII leak? Right? What if one of our suppliers screwed up and they didn't, you know, right? They didn't run our de-identification engine on the data before they sent it to us. Right? Now, all of a sudden we've got PII in the data. We can't have a fully automated process that's not going to catch that before it lands in our data warehouse, right?
We need to catch that on ingest and then be able to report back to the supplier that, "Hey, something went drastically wrong. We need to fix this, and we can't ingest it." Um but we also needed things like cost transparency and model and monitoring. Um and then we wanted to really focus on what the deployment scenario was, right? We want our engineers to be able to ship their pipelines without talking to platform teams, without worrying about the code for the infrastructure.
So, we looked at the technologies available and decided, "All right. What's out there in the marketplace, and what is out there native to Databricks that's going to allow us to build for this?" Okay? So, first, Lakeflow declarative pipelines. Um Yeah. Uh up until this morning, this said DLT on my slides. Um but so that gives us a way to define our data transformations as code, right? Not just SQL, we've got real logic, real structure.
And it means we can stop thinking about our data, stop thinking about our dependencies, um and just focus on chaining trusted tables together declaratively. Um expectations, right? We've got first-class quality controls built right in. Um they're not perfect, but you know, with a little bit of creative engineering on top of it, you can make it really work for your use cases. Um we knew we wanted to use Autoloader as part of our ingestion pipeline.
Right? I mean, this thing is fast. We don't have to worry about wiring up file polling or worrying about object notifications. Right? It just watches the source. Batch or streaming, it's the same code, right? It abstracts away a huge amount of complexity for us. Um we knew we wanted to use native triggering. We knew we wanted to use serverless compute, right? We don't have to want to manage anything. We just want to write code.
Um and speaking of writing code, we knew we wanted to use Python instead of SQL. And the reason for that is that we wanted to be able to build fully unit testable transformations. We want real, complex programmatic logic, uh quality controls, conditional flows, decorators, abstraction layers that just wouldn't be feasible in pure SQL. And then for the deployment, of course, Databricks asset bundles. Right? So, this way we can ship full pipelines with one command, the code, the config, the environments, permissions, all of it's versioned and automated.
We can track all of it. We've got the history on all of it. Uh and we can plug that right into CI/CD, right? Deploy with a click from the console or deploy inside of GitHub Actions. All right. So, going into how we build it, this is a very simplified version of what the high-end data flow looks like. So, the first thing that we wanted to look at is how do we handle our supplier data? Right? HealthVerity brings in data from over 80 different suppliers.
The size of that data could range from, you know, in a single delivery, one supplier might send us 150 gigs of information, and another might send 150 terabytes of information. Right? Anything from millions of records to billions of records. So, one of the things that we wanted to do was split these concerns up. Instead of having one bronze and silver layer across the entire organization and across the entire warehouse, we wanted to treat the individual suppliers as microservices.
Right? So, what we actually have is we have a GitHub uh organization that has 80 different repos in it, one for each supplier, and that contains nothing but the bronze logic and the silver logic, all of it declarative, all of it ready to go. So, this way we can ship one supplier in isolation from another supplier, ultimately aggregate that together into our gold layer and into our consumer layer, where we can run, you know, additional privacy rules, additional conforming standards, um you know, reference table lookups, whatever we need to do.
So, let's go into how we started this. We started out with how are we going to manage bronze? Going back to I don't want my data engineers worrying about orchestration, right? So, what we did is we started building our building our own configurations, and we said, "Hey, can we abstract around autoloader?" Right? So, So, for the landing zones for the data, we went with for bronze, we have a simple YAML-based configuration.
You give it the schema, you give it the relative path or name of the data set. You can give it some rules for how do we want to quarantine the data? Do we need some options to tell autoloader to do things a little bit differently, right? And override our defaults? Um do we have rules where we need to drop the data, right? In this case, in the example, you can say, "Hey, we've got we've got a rule set that says if we see a particular loan code in that data, we're going to drop it.
We don't want it in our warehouse." Right? And that leads to what ends up being a really complex DAG. Some of our suppliers will send us 100 tables as part of a single delivery that we then need to piece back together. Right? But now the whole thing is triggered by file arrival events. Um these configuration files become streaming tables with expectations. Quality's rolled up as you can see from our from the individual QC tables to the batch status details uh and then to the batch status where for each batch of data that's delivered to us um for us our batches are basically based on the date of delivery.
Um we know what the quality was of that entire batch in aggregate before we bring it forward into our silver layer. And all of that's generated based on data set level quality checks. And you can use whatever you want. You can use a bespoke framework for that. Um you can use DQX for anyone who's attended sessions on that. Um but what we wanted was to allow this to do automatic filtering downstream as we bring the data into our silver layer.
Now for those of you who've been at talks about DLT, right? All of the examples are always the super simple DAGs. You know, you got three tables, four tables, whatever. Doesn't really tell you how to do it at scale. I'm sure for many of you this is a much more realistic representation about what your what your DAG looks like and this is only a very small zoomed in snapshot. Otherwise, you wouldn't have even been able to see that they're tables.
And this is for one supplier's logic. All right. So, how do we simplify the silver workflow? Well, the first thing we do is we create custom readers that pull from our bronze or silver layers while automatically quarantining results based on those previous quality metrics. Behind the scenes, these methods like read bronze table actually go out and join that data against our batch status table and determine whether or not that batch is actually ready for ingest.
So, this way our engineers aren't thinking about it. It's already done for them as they go to build their pipelines. Okay? Um we also leverage make heavy use of PySpark's transform method. For those of you not familiar with it, transform is how you build unit testable transformations. Right? You know, you could have 50 or 100 with column calls, it doesn't really matter. Right? You lock that away in another piece of piece of code, you write unit tests around it, you trust it.
And then you bring it right into your pipeline with one command. Okay? The other thing that we did here is you could see instead of calling dlt. table, we have this Theseus register table. Right? So, we've built custom decorators to handle registering quality control suites, right? Uh performing schema validation, doing all these pieces that you really need for a robust production pipeline. We wanted to again, we abstract all of that away.
Our engineers shouldn't have to worry about it. We have right? We have organizational level logic that should apply to that no matter what supplier we're talking about. Um here's you know, here's a stripped-down version of what some of that logic inside the decorator looks like. Right? So, as you can see it wraps around dlt. table. Hopefully every one of you can see this. It's not Um although we did have some of it commented out.
Um but this enhances our workflow, right? We we we look up and then we apply quality checks automatically, right? Because we know for example, we've got a table called med claim. We know what QC checks we want to run on med claim. Right? Um it will allow us to apply schema enforcement, right? Again, we know what the schema should look like or at least the super set of the schema should look like for that table. Um and then it also registers a list of tables that we can pull from at runtime in order to then turn around and automatically build all of our aggregate analytics similar to what I just showed you all in the bronze layer.
Um going into schema enforcement, right? We focused on standardized schemas. So, for those of you unaware, Spark natively supports JSON as a source for building out a struct type object. Okay, so why not leverage that, right? Use the power of the platform to work for you. Right? So, all of our data types, all of our metadata, everything that we need to apply for every single one of those columns as part of our data contract is present within within each of these schema documents.
Right? So, most suppliers are only going to implement a subset of those columns, right? One table might have, you know, might be a super wide table with 200 fields. You know, for supplier A, we might get eight fields. For supplier B, we might get 50. Right? So, we don't want to force all of them to always use the same super set of columns and just cast everything to null every time we're running our pipeline. Right? Um that doesn't scale.
It doesn't make it easy to add new columns to your schema, right? Um it it really locks you in. So, we wanted to avoid that. Um and what we do here is we compare the data frame schema with the with the data types, right? We look for mismatches, um and we apply the column metadata, right? Everything that we need to build a data dictionary on top of Unity Catalog is already embedded in these schemas inside of our code.
So, the high level, how does each each of these zones work? Right? So, the supplier bronze layer, which I showed you, we're leveraging those YAML extractions, uh we can rapidly onboard data through um through LDP, still have to get used to that term, uh and auto loader. Uh initial quality checks we can be run on that data. Then in our supplier silver layer, our engineers, once again, all they're writing is transformations and unit tests.
They don't have to worry about setting up the quality checks, the business rules for it. All they need to know is that they've worked with their with their subject matter expert, they distill down the business rules of how do I get the data delivered to me from supplier A into my common data model. Right? The quality checks um also are able to inspect the schema uh in our system. So, we have quality checks defined for every one of those 100 columns in a table, but it's able to look and say, "Hey, this column isn't there.
It's not on the list of required columns. Therefore, I'm not going to throw an error. I'm just going to ignore the check." Right? And this will allow our teams to scale. And then in our gold layer, we actually commingle all of that data together. So, this is where we bring it back together. Right? Uh we use a combination of streaming and unions and materialized views, bring that data together from our from our various silver layers, and we can actually go out and inspect these.
Right? Because each one of them is following the same format. Each one has a batch status. Each one has details on it. Each one has history. So, this allows us to basically look at our catalog, right? Our gold job doesn't have to know what the list of suppliers is. It looks at our catalog, it looks at our schemas, and it says, "Oh, hey, I've got supplier A, B, C, D, E." Right? I've got schemas for all of them. I have a batch status that says that batches are ready to be picked up, and I just start picking them up.
I also have a batch status table for supplier G, but all the batches are marked as being on quality hold. So, I'm not going to do anything with it. I'm not going to pull it forward. Right? So, going past that, let's look at deployments. Right? So, for those of you who have used Databricks asset bundles, right? They're a step forward, but they can still be really hard. Right? It's more things for your data engineers to worry about.
They have to worry about your cluster their cluster sizes. They have to worry about when these jobs get triggered. They have to worry about if you have a multi-step pipeline, how are those built? Right? So, keeping on that, you know, that mindset of we want to do configuration, not code, we also built out this supplier uh config file. So, this effectively the entire control file for the the whole supplier microservice.
Right? So, it defines our bronze tables. Um we can actually bring those from an external file as well, um which is kind of a backwards compatibility check for how we originally started building this. And you basically just say, "Hey, my S3 bucket looks like this. Where's the data at relative to the root of the bucket? Right? Um are we treating these batches as restatements or not? Right? So, some of our suppliers actually send us incremental updates.
Some of them um aren't equipped to do that. And so, once a month we'll get an entire restatement from that supplier of absolutely all of their records, all of the data that they've contracted to send with us. Um we have the ability to override our standard quality checks. We can add to them or we can override them and say, "Hey, you know what? Maybe for this particular supplier's data, maybe we have a threshold on a particular quality check.
Um when we get to an aggregate level that we know, you know, maybe 15% of records normally um could have this attribute. And that's okay, but for this particular supplier, maybe only 10% is okay or maybe 20% is okay." Right? We want to be able to uh support that sort of functionality. Um and then what we do behind the scenes is we use the new Python experimental API around Databricks asset bundles to parse out this supplier config file and use that to actually build our Databricks asset bundles for that supplier.
Right? So, once again, our engineers, they worry about configuring the supplier. They don't have to worry about configuring how those pipelines get deployed. Right? so here's here's just a snippet of what PiDabs kind of looks like. And in this case, you can see we're configuring a job from a dictionary. And we're actually looking at the steps that we have built out before. And we're going to define all of our pipeline tasks in order based on what we extrapolated from that configuration file.
All right, so this will set up the file arrival triggers that we need. Um this is going to create this bronze and silver pipelines as needed. Right? You know, maybe we don't have silver data for that particular supplier yet. Um it's actually not just uh and we're and because it's Python, we don't have to limit it to just inspecting the configuration file. Right? We can go in and actually look at their code and say, "Hey, do they have any pipelines actually defined inside of that inside of that module?"
And if they don't, no reason to deploy silver, right? They're not ready for it yet. All they've done is uh start with the bronze ingest, and they're still ready to deploy. Um but then it takes all of this, it'll wrap it up in a in a in a Databricks job, uh and then it can be deployed once again through the CLI, through a simple Databricks bundle deploy, or it can be deployed as part of a GitHub action. So, what does all this mean together, right?
We've we've heard a lot about the power and the speed behind uh DLT or now Lake Flow declarative pipelines. Right? What impact has this actually had for our business? If you remember, you know, we were talking about we had a legacy Hive data warehouse. Then we had which was the other attempt that didn't really pan out. And now we have this project Theseus. Does it actually matter? It does. So, this is based on data that we took from a few different runs of processing data from one supplier, roughly a 10 10 TB batch delivery.
Uh and the numbers at the bottom, these are hours. So, under our legacy Hive base system, right? It would take us anywhere between It could take us for that batch anywhere between 12 and 14 hours to process that data. And then on top of that, we still had to run out-of-band manual quality control checks on top of it. Right? Bunch of notebooks, you know, people manually engage with the data. Um so, we went to the system, where things are a lot better, right?
Uh 14 hours turns into about half that time. Um but we still have a few hours for people to go in and run the quality checks. It's not built right in as we load the data. Now, we go to that same batch on Theseus, and the whole thing is done in 27 minutes. So, from bronze ingest to silver to all of the built-in quality check frameworks, we don't have to check that data manually afterwards. Right? So, obviously, this is huge, especially for a migration effort.
So, if we think a little bit about what's next, where are we taking this beyond this? Right? So, we're currently exploring migrating from our custom QC framework to whether or not we can actually utilize DQX, move to more standardized tooling. Um we're going to be building Lakeview dashboards or apps to handle our wareh- warehouse health, uh and we're really excited about Unity Catalog metrics and its ability to help us out with that, right?
Standardize those business rules uh across the organization. Uh we're also working uh with our inbound suppliers on enabling Delta streaming, right? So, now we don't have data that's getting delivered into an SFTP site and dropped into an S3 bucket. Now, we're grabbing their data live directly from their catalog. Right? And of course, that could be either an Iceberg catalog, right? It could be data ho- housed in Snowflake, or it could be data ho- housed uh directly inside of Databricks.
Um we're looking at exploring dynamic views and row and column masks um downstream. Um you know, many of you, we have you know, this is just the smallest part of the data that we have as an organization, right? This is where it starts. So, we have a lot of different use cases throughout our organization. We want to make sure that we can build views that actually help them gain the insights that they need uh instead of just trying to consume everything and then make sense of it.
And then we're also looking at building in change data capture for every entity within the warehouse. So, we go back to those data migration problems we had, right? Legacy system, EMR with Airflow, jobs and bespoke orchestrator. We had unmanageable unmanageable SQL code. Right? We had some advancements in terms of the data formats we were using. We didn't have unit testing, we didn't have integrated QC. Uh we had very difficult deployments.
Um limited to no modularization. Lineage was a joke. And we didn't have any data monitoring. Right? But when we put all these various Data Bricks techno- native technologies together, we go to now we've got LDP and file triggers and sharing. Right? Uh we've got clean opinionated Python. Unity Catalog, Uniform, and change data capture. We have unit testing and expectations. We have microservice-based deployments. Um all everything is modular and abstracted.
We have lineage through Unity Catalog that actually makes sense. And then we have Lakehouse monitoring on top of it. So, we put those put everything together, now we've gone from data migration problems to now we have my data migration solutions. All right? Thank you, everyone. Um please for those of you, I'm sure you've seen it with everything, uh please complete your surveys. Um you know, let people know if you want to see me back here again next year.
I appreciate it. And then definitely open to any questions.

Learn more about the Databricks Data and AI platform.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.