Your databases, together in DuckLake.
Start with DuckDB 2. Query PostgreSQL and MariaDB, join their data, and save the results as Parquet in managed R2 storage. Keep working in the same SQL console.
DuckDB 1 is also available. Managed DuckLake requires DuckDB 2 and is included on Pro and Dedicated.
PostgreSQL + MariaDB
Read-only sources
DuckDB 2
Query, join, then copy with SQL
DuckLake
PostgreSQL catalog
Parquet data in managed R2
From local tables to saved analysis
Use standalone tables, read connected databases, or save lake snapshots. PostgreSQL can be a source, the metadata catalog, or both. MariaDB supplies source data; it does not host the managed lake catalog.
- Standalone DuckDB 2
- Create local tables and run analytical SQL in a self-contained database file.
- Query PostgreSQL
- Read tables through a dedicated SELECT-only source login.
- Query MariaDB
- Attach eligible MariaDB tables as a read-only source.
- Join both sources
- Combine PostgreSQL and MariaDB data in one DuckDB query.
- PostgreSQL to DuckLake
- Copy a PostgreSQL query result into a lake table.
- MariaDB to DuckLake
- Copy a MariaDB query result into a lake table.
Choose where your SQL reads and writes
Examples use customers and orders tables you supply. Qualify local tables with layerbase.main and lake tables with ducklake.main: the active lake can become the default catalog.
Keep a local table
CREATE TABLE layerbase.main.local_example AS
SELECT 42 AS answer;Join two sources
SELECT p.id, p.name, m.city
FROM pg_source.public.customers p
JOIN maria_source.customers m ON p.id = m.id;Save a PostgreSQL snapshot
CREATE TABLE ducklake.main.orders_snapshot AS
SELECT * FROM pg_source.public.orders;Save a MariaDB snapshot
CREATE TABLE ducklake.main.customers_snapshot AS
SELECT * FROM maria_source.customers;Set up your managed lake
- Create DuckDB 2 and eligible PostgreSQL or MariaDB databases in the same personal account and server container. Start the databases before attaching sources or enabling the lake.
- Open DuckDB’s Sources tab. Choose each database and give it an alias, such as
pg_sourceormaria_source. Test the read-only attachments. - On Pro or Dedicated, choose PostgreSQL as the catalog and enable DuckLake. Layerbase manages the private R2 bucket and temporary storage credentials.
- Run an explicit SQL copy into
ducklake.main, then query your saved table. One managed DuckLake is supported per account.
Keep source and catalog databases running while querying them. Review the lifecycle restrictions below before enabling the lake.
Before you enable DuckLake
How do DuckDB and DuckLake fit together?
DuckDB runs your SQL. DuckLake adds lake tables alongside your local DuckDB tables. PostgreSQL stores the lake metadata, and managed Cloudflare R2 stores its Parquet data. These are parts of one managed lake, not separate storage modes.
Can I still use DuckDB 1?
Yes. DuckDB 1 remains available for standalone databases and supported account sources. Managed DuckLake requires DuckDB 2 and does not upgrade an existing DuckDB 1 database.
Does this replicate my application database?
No. Source queries read the attached database. CREATE TABLE AS SELECT saves a snapshot of the query result. Later source changes do not automatically update that snapshot. Source attachments reject writes.
Which plans include it?
Read-only account sources are available on every plan, within database limits. Managed DuckLake is included on Pro and Dedicated. Sources and the PostgreSQL catalog must be eligible databases in the same personal account and server container. Shared teams and app backing stores are not eligible.
Can I connect external PostgreSQL or my own R2/S3 bucket?
Coming soon: external PostgreSQL connections and bring-your-own R2/S3 storage. Today, use eligible Layerbase account databases and Layerbase-managed R2 storage. These upcoming options are not available to configure yet.
What happens to backups and branches?
A local DuckDB file backup does not include the lake. Retained lake state blocks normal backup, branch, restore, move, transfer and delete operations, including after detach. Detach keeps the catalog and objects. Recovery is operator-assisted; scheduled lake backups and self-service lake recovery are not available.