r/DuckDB • • 9h ago

Replaced Postgres with daily Parquet on Cloudflare R2 + read-only DuckDB for a public transit reliability dashboard (~US$10/mo)

Thumbnail
gallery
39 Upvotes

I run a free public transit dashboard (transit.yesid.dev) tracking live buses and historical schedule reliability across Montréal (STM), Ottawa (OC Transpo), and Gatineau (STO) (over 1,700 live vehicles on a busy evening, ~2.6M stop arrivals/week on STM alone).

Originally I backed the historical queries with Postgres, and as the GTFS-RT archive grew, storage and hosting costs kept climbing for a mostly append-only, read-heavy analytical workload. I recently rebuilt the entire engine around daily clean Parquet files on Cloudflare R2 queried by a read-only DuckDB service (apps/engine).

How the pipeline works (~US$10/month total):

  • Ingestion (Python): Polls each agency's GTFS-RT vehicle positions & trip updates, matches readings against scheduled trips, and writes clean daily star-schema Parquet files (bronze -> silver -> gold) to Cloudflare R2.
  • Analytical engine (DuckDB): A thin read-only DuckDB query engine reads the daily Parquet partitions directly for arbitrary date ranges, day-of-week / time-of-day slices, line/stop rankings, and 3D corridor delay rollups.
  • Edge + Frontend: A Cloudflare Worker data proxy caches hot queries in front of a SvelteKit (Svelte 5) + MapLibre + self-hosted PMTiles frontend. Users can also download the underlying daily Parquet or CSV files straight from the app.

A few analytical guardrails built into the SQL:

  • Never average averages: Every multi-day rollup re-aggregates raw numerators and denominators across daily partitions rather than averaging daily percentages.
  • Missing != zero (and != on-time): Roughly 35% of scheduled stop arrivals have no live GPS/prediction reading. They are explicitly left out and reported as observed coverage instead of silently treated as on-time.
  • 30-observation floor: Lines and corridors require at least 30 recorded observations before entering rankings so noisy 2-trip outliers don't dominate the leaderboard.
  • Live app: https://transit.yesid.dev/?ref=r_duckdb
  • Architecture & data pipeline write-up: https://yesid.dev/projects/transit-data-pipeline?ref=r_duckdb
  • MIT open-source repo (apps/engine + ingestion): https://github.com/yesid-dev/transit

Happy to answer questions on the DuckDB / R2 Parquet layout, partition sizing, or query caching trade-offs.


r/DuckDB • • 2h ago

AWS Scale and Multi Server execution with Duckle

4 Upvotes

Duckle 0.9.2: Multi-server execution is here.
One switch lets Duckle distribute workloads across multiple DuckDB servers.

Files are split by file, while database tables are split by key range. Each server processes its share, and results are combined automatically.
A few things worth mentioning:

Credentials stay on their respective machines.
Failed servers can have their work reassigned.
Unsupported sources fall back to your local machine.

Joins, sorts and API connectors remain local.
Also added DuckDB Scales support through Amazon Athena, allowing queries to run across multiple machines within AWS.

The video shows a real run with three local DuckDB servers processing 12 Parquet files. Results matched the single-server execution row for row.

There’s a small overhead, so single-server remains the default for smaller pipelines.
Free and open source. Build locally, deploy on your own servers or cloud.

Link - https://github.com/slothflowlabs/duckle


r/DuckDB • • 2h ago

Have you migrated to DuckDB 2.x yet?

2 Upvotes

Now that DuckDB 2.x has been released, I’m curious to know whether you’ve already migrated or are taking a wait-and-see approach.

I’m currently developing a statistical extension for DuckDB called DuckDB-stats.
https://github.com/mitsuruk/DuckDB-stats

It’s a personal side project that I work on mainly on weekends, so the time I can dedicate to development and maintenance is limited.

I’m currently trying to decide whether to continue supporting both DuckDB 1.x and 2.x or focus exclusively on 2.x.

Supporting both versions requires a significant amount of additional development, testing, and maintenance effort. Given that the current 1.x release is scheduled to reach EOL next spring, I’m considering focusing my limited development resources on 2.x.

I’d be interested to hear about your experience and plans:

- Have you already migrated to DuckDB 2.x?
- If you’re still using 1.x, when are you planning to migrate?
- Are there any technical reasons or concerns holding you back from upgrading?
- How important is continued support for older DuckDB versions in third-party extensions?

Your feedback would be very helpful in deciding the future development direction of my extension.

Thanks in advance!


r/DuckDB • • 5h ago

DataRanger: tests a data fix against the source's totals before applying it

Thumbnail
github.com
2 Upvotes

What My Project Does

DataRanger checks tables for data-quality problems (duplicates, nulls, unit errors, late partitions, broken references). For each problem it tries candidate fixes on a copy, compares the result with the source system's control totals, and applies only a fix that matches. Anything it can't prove goes to a person with the evidence. It never modifies your input tables.

pip install dataranger
dataranger demo

The demo runs locally in a few seconds on a sample table and writes an HTML report. No account or API key. It works with DuckDB, CSV and Parquet files, Snowflake and dbt, and runs as a GitHub Action or an MCP server.

Target Audience

Data engineers who own pipelines where a wrong number costs something. It's usable today but young (version 0.9), so I'd call it ready for trying on real tables, not yet for running unattended in production.

Comparison

Great Expectations, Soda and dbt tests tell you something is wrong. DataRanger starts there and goes one step further: it proposes a fix and checks that fix against the source before applying it. The limit is that it needs control totals from the source system, or a raw table to build them from.

I'm the author. Benchmark numbers in the README are on synthetic data. I'd value criticism, especially of the verification step.

https://github.com/akshaysharma1088/dataranger


r/DuckDB • • 1d ago

DuckLabs Introduces DuckDB Scales

Thumbnail
ducklabs.com
51 Upvotes

There's two big releases in this announcement. DuckDb Scales and AWS Athena Preview support.

We currently have petabytes of data usage via Athena and this looks extremely promising


r/DuckDB • • 1d ago

I made a DuckDB extension to query Semantic views with plain SQL

1 Upvotes

r/DuckDB • • 2d ago

Exploring DuckLake 1.1

Thumbnail
thefulldatastack.substack.com
20 Upvotes

Sponsored article where I go through the latest version of DuckLake. It came out alongside the DuckDB 2.0 release and I think a lot of people missed it. Some nice quality of life updates as well as a new 1.1 spec that allows VARIANT data to be inlined in Postgres. Good stuff.


r/DuckDB • • 2d ago

Using PL/SQL with DuckDB

7 Upvotes

I love Oracle's PL/SQL. I love DuckDB. Why not combine the two I thought. Here is the result: https://github.com/sqling-com/sqlingpl


r/DuckDB • • 4d ago

DuckDB as the analytics store for a nightly statistical engine: every metric × breakdown tested, each night replayable byte for byte (open source)

10 Upvotes

I'm Unni. We built an open-source (Apache-2.0) engine that checks a company's numbers every night for changes worth a human's attention, and DuckDB does most of the work.

How we use DuckDB:

  • One DuckDB file per company. Each night every metric × breakdown × grain series is materialised into it. It holds series and the aggregates needed for evidence, never full copies of source tables.
  • Each run is snapshotted to Parquet with an input hash, so "othor replay <run_id>" reproduces a night byte for byte, and CI fails if it doesn't.
  • PostgreSQL and MySQL are read in place and aggregated at the source. Google Sheets tabs can't be queried in place, so they're loaded into DuckDB, and their metric SQL runs there.
  • Metrics that span two sources are aggregated at each source, then joined in DuckDB on confirmed keys.

On top of that, 11 statistical detectors run across those series (PELT changepoints, offsetting totals, dip test + GMM and others), with all p-values corrected together by Benjamini-Hochberg (q = 0.01). A model never produces a number.

What I'd value from DuckDB users: is one file per company the right call, or one per run? And anything you'd do differently with the Parquet snapshots?

https://github.com/othorai/othor-ai


r/DuckDB • • 5d ago

Pairing small local models (Inkling 2 Mini, DeepSeek V4.1) with a local DuckDB MCP made a bigger difference than I expected

Thumbnail reddit.com
3 Upvotes

r/DuckDB • • 7d ago

Row by Row Processing in DuckDB

4 Upvotes

I built DDGBasic for exactly this gap — it's DuckDB with a procedural language wrapped around it.

SQL is great for set operations, but awkward for row-by-row rules, tiers, allocations, alerts, and file handling. In DDGBasic you can do:

basic

DATABASE ENGINE DUCKDB
DATABASE OPEN ":memory:"

CREATE TABLE domains AS
  SELECT * FROM read_csv_auto('https://raw.githubusercontent.com/cisagov/dotgov-data/main/current-full.csv');

FOR row IN (SELECT State, COUNT(*) AS n FROM domains GROUP BY State ORDER BY n DESC LIMIT 5)
  PRINT row.State, row.n
NEXT

Variables go into queries as bind variables (:name), you get IF, loops, user functions, transactions, and ON ERROR, plus LOAD CSV/JSON/Excel/Parquet with per-cell transforms and validation, and output to CSV, JSON, Excel, Parquet, or HTML. SQLite is the other engine if you want a transactional file DB instead.

GitHub: https://github.com/ddgflorida/DDGBasic


r/DuckDB • • 8d ago

Replicating Stripe to Iceberg v3 on S3 Tables for under $5 a month

Thumbnail
inflextrace.com
17 Upvotes

DuckDB 2.0 in AWS Lambda writing Stripe subscriptions to Iceberg v3 tables on S3: no warehouse, no Spark, and correct even when webhooks arrive late, twice, or at the same time.


r/DuckDB • • 8d ago

Full DaffyDB TDS Proxy/Gateway (ie. SQL Server Clients) for DuckDB is now in GITHUB

7 Upvotes

I've posted here before on demos and such, but I finally got around to pushing it all into github, all open source. It's quite the undertaking over several months..

https://github.com/TroBeeOne/DaffyDB/

Net Net - Start SSMS (or your reporting app, or PowerBi), point it at my utility with a normal connection string, write T-SQL, it runs on DuckDB instead of SQL Server.

- DaffyDB is the core engine, connect with powerbi, SSMS, etc and use T-SQL against DuckDB.

- DaffySQL is also included, this is essentially my custom SQL Server Extension, I made this over using the community SQL Server extension for DuckDB so it plays better with my .NET approach.

- TSQL Translation engine is there.

I've got videos on youtube if you want to see it in action, also DaffyDNA for VS Code is built to have a nice GUI into this. Related, I also have DaffyZoom (for SQL Server in-wire caching) pushed yesterday as well.

Enjoy. Open Source, MIT, etc..

I'll eventually get around to upgrading it to 2.x duck.. 1.5.5 for now.


r/DuckDB • • 9d ago

Making ETL into Apache Iceberg Tables fully inter-operable (readable by every engine/warehouse)

Post image
4 Upvotes

r/DuckDB • • 9d ago

ATTACH!

10 Upvotes

I remember setting up Teiid for data virtualization. Quite powerful, but it took some configuration.
Nowadays I just have to ATTACH the sources. DuckdDB almost takes the fun away from getting things working 😀
A good thing though, don’t get me wrong.


r/DuckDB • • 9d ago

duckdb-capped - a bounded storage extension for DuckDB

3 Upvotes

Hey all,

  • I had this itch to scratch for a low-usage, easy to maintain OTEL/Observability tool for my local work (agentic and general OTEL for services).
  • Things like Jaeger exist but I wanted something a bit easier to maintain. And I realized that having a Mongo-like capped collection or Clickhouse-like TTL would be available very nice and easy way to approach.
  • So I built this with help from Qwen (I have DGX Spark form a friend that I temporarily have access too :) )
  • https://github.com/hamin/duckdb-capped
  • Check it out. I posted in the Discord and hoping to get this approved to the community extensions

r/DuckDB • • 9d ago

Using DuckDB to Send Messages to Slack

3 Upvotes

I recently built a DuckDB community extension to be able to send messages to slack channels. Below is the write-up to the article. Let me know if you have any questions:

https://performancede.substack.com/p/creating-my-first-duckdb-extension


r/DuckDB • • 15d ago

A LiteLLM callback that writes each request to DuckLake

2 Upvotes

I wrote a small LiteLLM proxy callback that writes one row per request into DuckLake (Apache-2.0).

It’s a callback for the LiteLLM proxy. Each request lands as one row in a DuckLake table, partitioned by day: model, tokens, spend, latency, status, team and key. Prompts and responses are optional. Any DuckDB can query it.

Repo: https://github.com/starlake-ai/litellm-ducklake-sink


r/DuckDB • • 15d ago

Run DuckLake without a database

9 Upvotes

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.


r/DuckDB • • 15d ago

What DuckDB Needs to Be Enterprise Grade

2 Upvotes

Sponsored article but a good breakdown of what DuckDB needs to be enterprise grade. Things like RBAC, column and row level security. Hardcharger is a cool tool.

https://performancede.substack.com/p/beyond-embedded-duckdb-building-a


r/DuckDB • • 17d ago

Built vastgrid (MIT) – Open 100M-row Parquet, CSV & DuckDB tables like a 60fps spreadsheet (VS Code, CLI, MCP, Jupyter, React)

16 Upvotes

Hi r/duckdb! I built vastgrid, an MIT-licensed HTML5 canvas data grid backed by DuckDB (vastgrid-duckdb on Node.js) and a matching Web Worker engine (vastgrid-js) that both pass the same 300-plan conformance suite.

What it does with DuckDB:

  • npx vastgrid-cli sales.parquet (or the VS Code/Cursor extension yhay81.vastgrid-vscode) queries Parquet, CSV, TSV, JSONL, Excel, and .duckdb databases in place — sorting a 100M-row (1.38 GB) Parquet file to first visible rows in 953 ms on an M2 Pro.
  • Full-table multi-key grouping, cross-tab pivots, live column totals, exact decimal formulas (ROUND(0.285, 2) = 0.29), and 60 fps canvas scrolling with an ARIA keyboard grid.
  • Surgical CSV/TSV saves: editing a cell rewrites only the changed field's byte span, preserving untouched quotes ("0019"), formatting, and CRLF/LF so git diff stays clean.
  • Also runs inside Claude Desktop / ChatGPT as an interactive MCP App (npx -y vastgrid-mcp ./data) and in Jupyter (pip install vastgrid).

Would love feedback from DuckDB folks on tough Parquet/DuckDB schemas or features you'd want next!


r/DuckDB • • 17d ago

Building a bounded, read-only file-transformation CLI around embedded DuckDB v2.0.0 (sqrail)

3 Upvotes

Wanted to share an open-source project built on top of embedded DuckDB v2.0.0: sqrail (https://github.com/yhay81/sqrail, MIT).

First, a clear disclaimer (I am the author): sqrail does not try to replace the DuckDB CLI or claim faster query execution. Our benchmark harness builds both sqrail and duckdb from the exact same DuckDB commit (d54cbbe3) to verify output equivalence and track startup/RSS overhead (docs/BASELINE.md).

Why build a separate frontend? When automated callers or coding agents run local data transformations, a general-purpose shell exposes more surface area than a single step needs (arbitrary path reads inside SQL, COPY overwrites, ATTACH/INSTALL, unbounded spill/output sizes, or environment-heuristic output switching).

sqrail wraps DuckDB in a single-operation contract:

  • Explicit -t name=path bindings (files, globs, .gz/.zst text, Hive-partitioned Parquet directories, --strict-schema, and --all-varchar to preserve leading-zero CSV/TSV codes without touching Parquet/JSON types)
  • DuckDB allowed_paths locked to bound inputs + isolated per-process --spill workspace, external access disabled
  • Atomic no-overwrite -o commits across CSV, TSV, JSON, JSONL, and Parquet
  • Explicit CLI budgets (--memory, --threads, --timeout, --max-rows, --max-output-bytes, --max-spill)—e.g., sorting 10M Parquet rows under a 128 MiB DuckDB memory cap in 1.86s

Would love thoughts from heavy DuckDB users on any CSV/Parquet edge cases where --strict-schema or --all-varchar could be sharper.


r/DuckDB • • 18d ago

DuckLake walkthrough: snapshots, change feed and dbt incremental models on 3 months of Ethereum data

Thumbnail
youtube.com
18 Upvotes

I made a beginner course on DuckLake and wanted to share it here. Disclosure: I work on Rosetta DBT Studio, the app I use in the videos.

Everything in it is open source: DuckDB, DuckLake, dbt Core, Rosetta DBT Studio, and the course code itself. The data is public too. No cloud account, no server, no paid tier needed. Everything also works with plain DuckDB SQL if you prefer the CLI.

Code (one commit per lesson): https://github.com/Nuri1977/ethereum-ducklake-dbt

The data is public Ethereum Parquet on S3: 92 days of blocks (~660k rows) and one week of transactions (12.7M rows). It needs about 3 GB of disk and runs on a laptop.

What the course covers:

- Creating a DuckLake with a DuckDB catalog and loading it from S3- Snapshots and time travel (AT VERSION / AT TIMESTAMP)

- Updates and deletes without rewriting Parquet (delete files)

- Schema evolution, and the change feed with ducklake_table_changes

- Partitioning, file statistics, data inlining, compaction and cleanup

- Registering existing Parquet with ducklake_add_data_files (and why the lake then owns the file)

- Reading the catalog tables by hand

- dbt on top: staging views, plus incremental marts with merge and commit messages via a post-hook

Feedback welcome, especially on anything I got wrong about DuckLake.


r/DuckDB • • 19d ago

Querying live sensor readings and their Parquet history in one DuckDB view via NATS JetStream and ZeBridge

Thumbnail
github.com
6 Upvotes

I’m building ZeBridge, and one of its examples started with a dashboard question: if a truck sends a temperature reading now and I flush Parquet files once a minute, why should “latest temperature” be up to a minute behind?

Sensors publish over MQTT or NATS into a JetStream stream. An archiver reads the stream in chunks, uses DuckDB to write Parquet, and uploads the files to S3-compatible storage. A separate query process follows the same stream and keeps recent readings in DuckDB. One view combines those readings with the archived files, so a query for the last ten minutes can span both.

The interesting bit was deciding when DuckDB could drop a recent reading. Each archive manifest records the last stream sequence covered by the uploaded files. The archiver publishes that manifest only after verifying the upload. The query process loads the file, then retires the recent rows it covers. Using stream position for that handoff means a delayed reading can have yesterday’s sensor timestamp and still show up in the right place. If a sensor resends a value for the same timestamp, the view counts it once, including when the two copies fall on opposite sides of the archive boundary.

On a 4-vCPU Linux VM with local NATS and SeaweedFS, the native archiver processed 500,000 readings in 2.33 seconds, best of three runs. That measures archive throughput. I haven’t yet measured the delay from a sensor publishing a reading to a dashboard query seeing it.

For anyone querying a live feed alongside Parquet in DuckDB: how do you decide when to flush a file? I’d be interested in how you balance small files against the amount of recent data you keep in the live table.

Runnable example, architecture diagram and benchmark