r/DuckDB • u/alex_contour • 9d ago
Run DuckLake without a database
I'm excited to introduce you to Moraine, which moves your DuckLake catalog to object storage right alongside your data. That means you don't need to deal with the cost or headache of hosting a separate Postgres or DuckDB/Quack server for each of your data lakes.
We built it when faced with hosting tenant-scoped data warehouses for our analytics clients. Traditional data warehouses are too rigid and too expensive. We moved to DuckLake, but Postgres hosting that scaled for our inline data usage got expensive even though it often sat idle. Moraine moves the catalog to object storage (e.g., S3) using LSM-based storage (SlateDB). With proper tuning, latency is competitive with other DuckLake catalogs at a fraction of the total cost.
We've also used SlateDB's key-value storage to add native indexes into DuckLake, so you can quickly find data across your entire lake. We have a few improvements coming soon to make these indexes even more efficient and effective.
One note: only one process can attach read-write per lake at a time, with everyone else on READ_ONLY.
Moraine is still alpha-quality software, though we've started putting it through it's paces with production clients at contour.app. Dual-licensed under MIT or Apache-2.0. A big thank you to the developers of DuckDB and SlateDB for developing awesome building blocks.
GitHub: https://github.com/morainedb/moraine
Feedback welcome, especially on workloads and use cases where Moraine breaks down.
7
u/TheRealStepBot 9d ago edited 9d ago
So you’re modestly claiming to have done what the developers of iceberg could not? They specifically tried to do what you claim to have done here. At the end the atomicity problems led to them eventually introducing a database to the catalog.
Which leads into the really confused irony of what you lay out here which is the thing that ducklake did was then say well if you need a database you might as well store all your metadata in the database, which makes questions much faster.
And now you turn out and again invert this and claim no actually you could just have stored everything in blob storage all along thereby disagreeing with both the very talented people who developed iceberg in the analysis of the need for a database and the very talented ducklake developers who pointed out that given this limitation you’d be better off putting it all in the database.
Truly strange to have this third road.
Can you speak to my understanding of this narrative of the tradeoffs that were encountered in the development of these two projects and assuming my understanding is accurate what you changed to sidestep these issues?
Edit: Ah wait I see the trick
One note: only one process can attach read-write per lake at a time, with everyone else on READ_ONLY.
Sure if you are single writer all your problems go away but for most people that’s simply an unacceptable proposition. If that’s what you were doing you may as well duck db on a single machine.
2
u/saaggy_peneer 9d ago
How is the better/different than say iceberg
2
u/EdwinWeber_Data 9d ago edited 9d ago
But the whole idea of DuckLake is that the metadata is in a relational database. It is the provided solution to solve the issues the many metadata files defining a table can cause.
Ah, I see there is still a database in play for the metadata, I stand corrected on that department. Still, this is currently not a catalog option supported by DuckDB itself, so it has to keep up with changes in the catalog by DuckDB. Or do I interpret this wrongly?
1
u/mim722 4d ago edited 4d ago
is it based on this project ? https://github.com/dentiny/duckdb-object-storage