Skip to main content

Delta-rs Turning Five: Growing Pains and Life Lessons

Summary

  • Rust Implementation Success: Delta-rs brought Delta Lake's robust capabilities to the Rust and Python ecosystem, delivering a 95% cost reduction in one early use case.
  • Python Bindings Strategy: Early investment in Python bindings was crucial to Delta-rs success, enabling developers to avoid JVM requirements compared to Spark implementations.
  • Object Store Evolution: Delta-rs matured alongside the Rust data ecosystem, adapting to the era of object storage and evolving to support diverse file system implementations.

Delta-rs Turning Five: Growing Pains and Life Lessons

Watch: Delta-rs Turning Five: Growing Pains and Life Lessons
Talk by Robert Pack, Staff Developer Advocate, Databricks
Five years ago, the delta-rs project embarked on a journey to bring Delta Lake's robust capabilities to the Rust & Python ecosystem. In this talk, we'll delve into the triumphs, tribulations and lessons learned along the way. We'll explore how delta-rs has matured alongside the thriving Rust data ecosystem, adapting to its evolving landscape and overcoming the challenges of maintaining a complex data project. Join us as we share insights into the project's evolution, the symbiotic relationship between delta-rs and the Rust community, and the current hurdles and future directions that lie ahead.
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 Delta-rs and why does it matter?

Delta-rs is the Rust implementation of the Delta Lake protocol, bringing Delta's capabilities to the Rust and Python ecosystem. It delivered immediate value, including 95% cost reductions in real-world deployments.

Why were Python bindings important for Delta-rs?

Python bindings allowed Python developers to use Delta-rs without the JVM requirement that Spark's Delta implementation demands. This was crucial to the project's adoption and success across the Python community.

What challenges has Delta-rs faced?

Delta-rs had to navigate the 'age of object stores,' requiring support for diverse file system implementations including local storage, AWS S3, Azure Blob Storage, and GCP Cloud Storage as the data landscape evolved.

Who are the main contributors driving Delta-rs development?

Delta-rs has many contributors from the Rust data community. Key early developers included Tyler and others at Script who pioneered cost-effective log data ingestion, demonstrating the project's practical value.

Full transcript

Hello everyone. Uh I'll be talking about Delta RS, a project very near and dear to my heart. It's turning five today. Uh Delta RS is the Rust implementation of Delta, the Delta protocol. I presume most of you here being uh at a at a data bricks event know what Delta is. And obviously Rust is also something people uh has gained more and more popularity in the last years. And um I've been with Delta RS probably since year two or something.
So not quite from the beginning but uh I have the honor sort of uh in the name of all the contributors to talk to you a little bit about what we learned implementing this. Um so let's get into it. So we'll start with a brief history of Delta RS. Oh here by the way you you might uh be seeing seeing those two who just joined. Uh if you have any questions about the actual implementation of Delta Rust, please uh direct them to them.
They're two of the main contributors of the project and they can also fact check me. Um but yeah, we'll start with a brief history of Delta RS and I think one of the most prominent cases in Delta RS is that it delivered value more or less from day one. So Tyler uh who is sitting in the audience right now uh is one of the original creators and they had a use case at script where they wanted to ingest large amounts of log data into their delta tables and wanted to do this in a very highly costefficient way and delta res was the vehicle to do this and they were able to and there I uh you can't see the link but if you search for dis 2022 he talks about and they managed to realize a uh 95% cost reduction by using this implementation versus the previous deployment of Delta.
So uh Rust however back then and today also is not the most widespread language and building the Python bindings early on was something that contributed massively to the success of um the Delta Rust library because Python developers also don't like the JVM. So the Delta Spark implementation or Delta Python bindings uh require you to have Java installed on your machine and that's something that you can avoid with Delta RS as well.
So now we get into something that I like to call the age of object store. So Delta being a mainly filebased format, right? So when you read a delta table, you essentially parse a directory and need to access files on that directory. But when you say file system, there is a bunch of different implementations out there, right? There's local file systems. A local file system on window also behaves very very differently than maybe a file system on Unix um in ways that can trip you up many in annoying ways.
And if you look at blob storage, for some reason, Microsoft felt it prudent to provide us with an implementation of blob fine. And then they had blob gen 2, which behaves a little bit differently. And then they had blob gen two with hierarchical name spaces, which again behaves a little bit differently. And then obviously sort of a lot of the existing implementations, one HDFS and all of these kind of implementations caused a lot of pain for us.
And it's sort of the small things that really kind of kept on coming up. One thing uh and this is actually just an artifact from the early days of Hadoop and Hive where you did hive tile partitioning. You need to encode your data in your file path. In Delta that's actually not necessary or required anymore, but a lot of implementation just did that. And all of these file systems just behave a little bit differently in what they encode or don't encode and how they encode all of these things.
Listing was another thing that was really really annoying. We mentioned hierarchical name spaces on blob storage for instance. Um the list results you get back are different than from the list results without hierarchical namespaces. All of this kind of stuff. And at some point the majority of the issues we saw especially as people started deploying the software in more and more environments were related to this configuration doesn't work.
I want to use multiple credentials. You're picking up the wrong environment variables. And Rust at that point in time was an evolving system. But luckily we weren't the only ones feeling that pain. But essentially the entire data ecosystem in RAS was feeling similar pains. So one thing that we did was um there is a project called data fusion and a company called influx DB I don't know if you're familiar with it's a time series database they had an implementation for object store and generously donated this implementation to the ecosystem and a lot of the Rust Delta RS contributors then went ahead and sort of helped and me amongst them helped bring this forward and create this object store uh crate.
And this object store crate finally kind of mitigated a bunch of those uh a bunch of those problems for us. And it's today kind of one of the the most widely used implementations, if not the most widely used implementation of object store um interfaces out there in the Rust ecosystem. So to me, this was a great success in the community coming together and sort of embracing the unit mindset, right? do one thing but do it well.
It was in feasible for us to maintain this within the delta RS great but now we have this implementation out there and it's fairly transparent wherever you go you can use this implementation um it's deeply integrated in data fusion the arrow ecosystem park reader all of them use this and it makes life much much much easier for us and this was a great success so this sort of concludes the age of object store and uh we're entering into the next phase of the delta RS project.
Um, reading a delta table is nice, but those of you who work with delta may know that it requires a bunch of maintenance. And the rust grade actually via its bison and bindings mainly was very popular or is very popular um to perform a lot of these maintenance operations on the table like vacuum, optimize, file system check, all of these operations that you need to do to keep your table healthy. uh keep it sort of op performant for queries all of these good things and since it's so convenient pip install delta lake run the command versus doing all sort of the the spark Java overhead this is something that came along but something that also came along with this is people started contributing quite a bit so the the the age of operations as I call it was also when when a lot of contributors started coming into the project and uh actually contribut buting individual operations because I said I want this sort of thing and uh this was to me at least in my memory uh a big gain in how many contributors we had and how how active the community was because it was becoming useful beyond this initial appendon use case that we're targeting in the beginning.
So um we now have a bunch of operations but operations require access to the log and especially when you're in the business of committing quickly and again the the first use case was doing a lot of high velocity commits from a streaming source into these delta tables what's called your delta log. it's growing at a fairly high rate, right? And all of a sudden just keeping the metadata from these delta tables in memory became a data problem.
And there is a mantra in uh uh open table format in general which says metadata is data. So in the next phase of the project we sort of embraced this mantra and said okay if metadata is data then we should treat it as such right. So why would you treat data differently when you read it or when you do do metadata? And what that meant was we applied the same tools, the same the same abstractions that you would use when you read and scan a table, I can sort of say it's particularly it's arrow.
So rather than having these explicit strcts that enumerate all the actions in there, we we just store them as you would store data you're processing for your analytics use cases. And that sort of reduced the the memory footprint and the resource consumption quite a bit which also and this is just of in brackets um helps you when you want to run this in resource constraint environments like lambdas things like that which is uh where where you you really want to be mindful about how much memory you consume and using these optimized storage representations also for delta log was kind of the next evolution, the next step in how we could could evolve this project, right?
So now we have metadata as data, but our Python users were still the main users of the library. I mean there's people adopting this in Rust, but most people consumed this uh via Python bindings. So initially we had some great implementations based on Pyro but the next phase sort of the project and this is very recent and if we look at aton here in the crowd he is one who drove a lot of these developments. Um we went sort of into the next phase of uh the Python bindings and how interoperability works uh in this ecosystem.
So we we initially worked with pi arrow as a library uh and sort of did all of this back and forth with the delta log and the again right we we have the log and arrow so pi arrow is a a natural choice to process is also on the python side but I don't know how many of you know how big pi arrow as the the binaries are right now so when you take in pyro as a dependency you get about 100 120 megabytes just for this library.
And again, if you want to run this in a container, you can build a Rust container with 30 megabytes and then bam, you get like 120 megabytes on top just to do a little bit of Python um uh Python operations on arrow. So there is this thing called the py capsule um which is a very efficient interface to exchange arrow between different implementations. And this actually enabled us to unlock a lot of features that we wouldn't want to implement ourselves, right?
I mean, ultimately, if you have this data, you want to run queries on top of this, but we didn't want to implement a query engine. But if you look at this uh little script, you can execute this script as is, more or less. You see, I mean, we're just importing a bunch of libraries. Polars, duct tb, daff, delta lake, fire. You can extend this to pandas or well I don't know all the libraries out there but if you execute this script today and run a memory profile on it you should see very little memory spikes in there because in all of these implementations we just load the table um and this py capsule interface allows these libraries in the back end to just shove around the arrowes.
So you can read it with delta table, you can query it with polars, you can put the results into arrow, you can use daft if you want to run some other queries on it. And since you're I don't know feeling SQL today, you can then use duct db to write a SQL query. Run this also on top of this. There's a little little thing with duct DB that I I enjoy and I don't think only duct DB does it, but you see we actually don't pass anything to DUTDB. just take the name of the variable from the environment and it just sort of automatically gets consumed in there.
So, Delta Lake actually doesn't need to implement any of these higher level operations, but because we integrate at the low level with this sort of py capsule interface, we can shove around these aerobitty and all of these libraries can just consume them and this is virtually zero cost. virtually. Sometimes you have to pay a little bit of um of overhead uh but negligible in terms of copying everything around all the time.
Right? So the next slide we need to um and now we're a bit future looking. Right? So this is what I would say the current phase kernelize. There's this project delta kernel RS um which tries to abstract away uh a lot of the internals of reading the delta log. But the thing I'm going to talk about here today is um how you can think differently about what a feature is of delta. And when I say delta feature, you know, partition columns, check constraints, um all of these things. um you can actually express and let's start with partition columns right a petition column it's just okay I have this constant value for this file you can write this in something similar if you wanted to do it as SQL as we have here right you can just say okay take whatever this constant value with this column name and then give me the rest of the columns right that's sort of actually sort of an implementation of petition values column mapping column mapping is a feature where sometimes you want crazy names that maybe parket doesn't actually support which is where we store the data for your columns.
So you can sort of have this virtual layer of naming for your columns that I don't know fit your personal needs or preferences or whatever a little bit more and delta abstracts it in a way that we can still store the data. So this is actually just renaming columns. See it's very useful but it's just renaming columns and expressions. Generated columns same thing. Generated columns is just applying a function on some values.
So why am I telling you this? Oh and we also have check constraints. Check constraints is uh a quality check on your data and you can also just express that as a SQL query, right? You can just say okay select uh count from this table wherever this condition is false. And when we have a count greater one, we've violated our check on string. And this is sort of where we're moving the library right now. Um trying to do more and more of the operation actually on top of the data rather than implementing them explicitly as logic because we already have all of these tools, right?
We already have tools that are able to evaluate expressions and do so very very efficiently on top of large data sets. So why would we kind of reinvent the wheel and try to do more of this stuff? And this again applies to a bunch of the features that you find in Delta tables as well. So we're almost at the end of sort of the history portion of this. Um Delta Lake Python 1. 0 just has been released. We're currently looking into adopting uh Delta RS for the kernel library for log replay.
The operation planning that's something we talked well operations planning like vacuuming things like that is also something you can just do via expressions. You just query the log query the log and um you can you can start planning way uh and query the log means you have all the file metadata and you essentially write a SQL query on top of your file metadata say which file expired which can I delete all of this kind of good stuff.
Um and one thing that's sort of also a big topic is synergies with other open table formats. I can explicitly name them. Iceberg, hoodie come to mind. Uh a lot of these formats try to achieve the same thing. And we're actively working with the community to see how can we work better work together to make this work and not everybody reinvent the wheel. So I have to look a little bit of time but there are some lessons we learned along the way also uh implementing all of this and we'll go into some of those lessons. one and this is actually I don't think delta is an Apache project um but still community over code is a credo from Apache that I think is very very important right essentially saying you can have a great code base but if it's sort of written by an individual contributor and you don't have a healthy community around it over time it will lose out to a project that has a healthy community maybe today isn't as good but will evolve much much better right so looking into a healthy community is um a very important thing.
That being said, one thing I also observed is often times new contributors come in with a need either well we don't know why, right? So they may be working for a company, they may just be excited about implementing a feature. But a lot of this let's say bigger shifts in features actually happened with people coming in and the the example I have in my one of the most complex operations we have is merge right implementing merge is very hard and uh this was at least the sorry the bulk of the operation was actually implemented by a single contributor who came in wrote a couple of thousand lines of code and uh gave us merge right so this is something all awesome and community is is is is very very important.
We also learned not every user is the same. Especially with Delta, I sometimes distinguish between two kinds of users and say all or nothing. So either they just want to read the data. They just want to read a delta table and they're fine or they actually don't really want to read the delta table. They want to understand the delta table. They want to maintain it. They want to look at their log. They want to see all of this.
And this is something we I feel did wrong in the past. We tried to build one API to serve every user and this API ballooned and has many many different let's say nichy kind of functions and we're in the process of trying to untangle some of this and maybe create something that's a little bit more tailored to individual users. Another one that I learned and this is probably one of my favorites. Schema doesn't mean schema doesn't mean schema. um there is a very clear distinction between what a logical and a physical schema in that sense is and I don't know how many of you are familiar sort of the internals of arrow and how data is represented but my my favorite example is on a logical sense you can say I have a string sure it's a string column but when you look into how you can represent a string column in arrow there's many different ways how you can do this these Easy one, UTF8.
Large UTF8 just means you can have larger strings uh or more strings. Essentially, you can you can store more offsets. There is something called German style strings or string views which actually just stores slices of these strings and then pass these around which is very very memory efficient. There's something called dictionary encoding where you have I don't know let's say area codes for countries or something right might be a string column but there is a finite number of countries so you have a finite dictionary and it's much much more efficient to just store this as integers.
So what you do is you build this dictionary of your of your vocabulary and then store integers. But all of these are very different physical representations of the same logical type. And in delta we often need to go back and forth between one and the other right because we we read it as logical but then we need to make a decision of how do we present this when you actually query the data and this is something that's uh majorly annoying that leads to a lot of casting code in the codebase um that we have to deal with another thing and um I just love this picture of cauliflower uh I I don't know but history repeats itself but also So delta is just paret for files let's say there is more to it don't get me wrong but if you take uh file stats which is what's collected on delta and which is what's used for let's say the file skipping feature right in park you have something very very similar which is page stats bloom filters you can have bloom filters on delta you can have bloom filters in par group pruning is file skipping so essentially you're you're you're trying to solve the same problems just on different levels which is something I found uh found quite interesting and as you go into it yesterday we talked a bunch with the data fusion uh developers and you can reuse a lot of this logic across the layers and and push it down and this is work we want to do right so that when you query a table the predicates we use it to prune the files you can use it to prune your row groups you can use it to prune your data pages so that it sort of transparently goes down.
It's almost fractal. Um, yeah, I think we're at time. We are at time. Uh, I could talk a bunch more about this, but if there's any questions around this, please let me know. Uh, happy to answer them or direct them to to the folks in the first row. All three of them either are prolific contributors to the project. Um, yeah. Thank you.

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.