DuckLake with a Postgres catalog and S3 storage is the setup most people mean when they say "a lakehouse without the cluster". Postgres holds the table metadata. The bucket holds the Parquet files. DuckDB, on any machine that can reach both, reads and writes the tables.
This post sets it up step by step. I ran every command below against DuckDB 1.5.6 and Postgres 16 in a throwaway Docker container, with the data on local disk. The S3 part is from the docs, and I label it where it starts.
What goes where
Three pieces, each doing one job:
DuckDB (any number of processes, any machine)
│ │
│ catalog: snapshots, │ data: Parquet files
│ schemas, file lists, │ and delete files
│ small inlined rows │
▼ ▼
Postgres database s3://bucket/lake/
Postgres is not storing your data, apart from small inlined writes. It stores the facts about your data: which files belong to which table at which snapshot, with their statistics. That is why it can stay small. In my 50-commit test the catalog grew by 80 KB.
Step 1: an empty Postgres database
DuckLake needs Postgres 12 or newer and a database it can create tables in.
-- in psql, as an admin
CREATE ROLE ducklake LOGIN PASSWORD '...';
CREATE DATABASE ducklake_catalog OWNER ducklake;
Making the role the database owner matters on Postgres 15 and newer, where ordinary roles can no longer create tables in public by default. (In the lab I connected as the superuser.) Keep this database separate from your application's database. It has a different backup and access story.
This is the first part. The full post — including the rest of the working details — is on my site: DuckLake with Postgres and S3: a hands-on setup
Top comments (0)