, ,

DuckDB Scales: The Beginning of a New Era in Distributed Computing?

Well, well, well … the Duck has entered the cluster.

For years now I’ve been wondering what tool would eventually come along and give Apache Spark a run for its money, not that I have anything against Spark, having spent a good portion of my professional life writing and running Spark workloads, but surely we couldn’t go on forever living in a world where our options for processing large amounts of data were so limited.

I’m not sure I would have put my money on DuckDB being the one to eventually wander into the world of distributed computing, especially given how much time and effort the folks behind DuckDB have spent convincing the rest of us that we don’t actually need distributed computing in the first place.

And yet, here we are.

In the midst of all the AWS re:Invent announcements, DuckDB Labs announced something called DuckDB Scales, a distributed implementation of DuckDB that is currently available in preview inside AWS Athena, with the eventual intention of releasing the technology into the wild as open-source software.

Well, dang.

Of all the things happening in the data engineering world right now, this is one that I think deserves a little more thought than the usual LinkedIn post proclaiming that some new technology is going to change everything and put us all out of a job.

From a single machine to the cluster.

One of the things that has always amused me about the history of modern data engineering is that for the longest time we seemed to have two options when it came to processing data, you could either fiddle about with Pandas on a single machine or you could spin up a whole bloody Apache Spark cluster and hope you knew enough about distributed computing to not make a mess of things.

Of course, somewhere along the way, DuckDB came along and started poking holes in the assumptions that many of us had been operating under for years.

It turns out that when you build a ridiculously fast analytical engine that makes good use of modern hardware, can spill data to disk, and doesn’t require a small army of engineers to operate, you can get away with processing a rather absurd amount of data on a single machine. I think many of us who have spent years working with distributed systems found this somewhat refreshing, if not a little embarrassing, considering the amount of time and money we’ve collectively spent throwing relatively small datasets at relatively large clusters.

But, alas, there are still people out there with actual big data.

As much as I enjoy watching DuckDB chew through hundreds of gigabytes of data on a single machine, there comes a point where the laws of physics, the size of your data, and the amount of time you’re willing to wait for an answer all conspire against you. The folks at DuckDB Labs recognize that some of the most valuable analytical queries inside large organizations are precisely those that need to touch enormous amounts of data, even if those queries represent a relatively small percentage of the overall workloads being run.

What are you supposed to do with those workloads?

Well, until now, probably go back to Apache Spark, Trino, or one of the other large distributed compute platforms.

What exactly is DuckDB Scales?

The interesting thing about the architecture of DuckDB Scales is that the folks at DuckDB Labs haven’t simply gone off and rewritten DuckDB into some entirely new distributed database, rather they’ve built a distributed orchestration and execution layer around the existing DuckDB engine, allowing multiple independent instances of DuckDB to work together on the execution of a query.

There are some particularly interesting things going on under the hood with regard to distributed shuffles, object storage, fault tolerance, and speculative execution, and if you’re the sort of person who enjoys spending your evenings reading about the internals of distributed computing systems, I’d encourage you to go read the architecture post from DuckDB Labs.

But I think there is something more interesting going on here than the particulars of how DuckDB manages to distribute a query across a bunch of machines.

We’ve spent a number of years now watching DuckDB build up a reputation in the data engineering community for a handful of things that, quite frankly, shouldn’t be all that revolutionary in a data processing engine.

  • It’s ridiculously fast.
  • It’s easy to use.
  • It integrates with just about everything under the sun.
  • It has excellent support for different data types and formats.
  • It can process datasets larger than available memory.

The fact that we can now start talking about bringing those same characteristics into the world of distributed computing is what should be getting data engineers all hot and bothered. Heck, I don’t think many of us would complain about having another option for processing large amounts of data that doesn’t require us to spend half our working lives thinking about the infrastructure underneath it.

AWS Athena just got a whole lot more interesting.

Of course, we can’t really talk about DuckDB Scales without talking about AWS and Athena, especially considering that AWS now owns DuckDB Labs and Athena is where we’re getting our first glimpse of what this technology can do.

AWS has integrated DuckDB into the existing Athena workgroup abstraction, which means you don’t have to go about provisioning and managing some separate DuckDB cluster, figuring out how many machines you need, or any of the other nonsense that we’ve grown accustomed to dealing with in the world of distributed data processing.

I suspect that the sheer number of people already using AWS and Athena is going to make this a rather consequential development in the data processing landscape, especially once more of the DuckDB functionality that we’ve grown accustomed to becomes available in this distributed environment.

But, again, I don’t think the most interesting part of all this is that we can run some SQL against a few hundred terabytes of Parquet files and get our results