What the mode is
| who | what it looks like | |
|---|---|---|
| write | SQLite | the hot days live in SQLite (a row store: fast writes, cheap transactions) |
| export | a batch job | the old days leave as Parquet shards (a column store: compresses hard, reads fast, standard) |
| query | DuckDB | one query reads both: SQLite's hot file (sqlite_scan) + the Parquet history (read_parquet) |
The direction is the reverse of the obvious one.. It is not "a row engine reading a columnar file" (that road — a SQLite virtual table over Parquet — we measured and dropped). it is a columnar engine reading a row store's file
And the reason it could work at all: DuckDB's SQLite extension is already in our binary. sqlite_scanner is one of DuckDB 2.0's core extensions. nothing to install, nothing to ship, and the join is one DuckDB query
Three things we measured
① SQLite is the fastest writer of the four
The same data, the same machine (the aligned tier):
| engine | the bulk load | 100 small batches | together |
|---|---|---|---|
| SQLite | 4,634 ms | 24,747 ms | 29,381 ms |
| PostgreSQL | 10,966 ms | 57,480 ms | 68,446 ms |
| DuckDB | 19,352 ms | 78,837 ms | 98,189 ms |
| ClickHouse | 30,858 ms | 914,723 ms | 945,581 ms |
SQLite writes 3.2–4.2× faster than DuckDB (4.2× on the bulk load, 3.2× on the small batches). and it holds six times less memory under load (33 MB against DuckDB's 214 MB, three years of history at 20,000/s). "push the write down as far as it goes" — SQLite already had that half
② The history half is the cheapest we have
The same 2,767,665 rows, as Parquet, read by DuckDB:
| on the disk | the read | |
|---|---|---|
DuckDB · read_parquet | 52.9 MB | 0.03 s |
Columnar for the history, vectorized for the reads — that half was never in doubt
③ The mechanism: the export is the checkpoint
This is the part worth reading twice.
Today: DuckDB is both the hot store and the query engine, so every batch pays part of a checkpoint (the WAL reaches 16 MB, checkpoint, compress the row groups), so 14–30 µs a row.
In the mode: SQLite is the hot store — the write is a WAL append, no row groups are compressed, so 5.7 µs a row — and exporting to Parquet is the checkpoint (the rows are compressed into columnar, append-only shards). and it is a batch job, not on the write path. so the write path never pays the checkpoint's cost at all.
The two accounts line up: the write path 30 µs/row → 5.7 µs/row; the checkpoint moves into a batch job at 3.8 µs/row (measured: sealing 2,767,665 rows into the cold tier took 10.4 s). both roads together are cheaper than today's 30 µs/row
And there is a second consequence, which is the deeper one: the shards are Parquet — real storage, 52.9 MB for 2.77M rows. so the hot copy is temporary. which is what "Parquet as the core storage" means: the space the hot data takes is temporary, so the write can compress less
And the reads have one path: DuckDB reads both sides in one query. the reports run on one engine from end to end
And the knobs on DuckDB's side
| µs/row | what else | |
|---|---|---|
| DuckDB today | 19.6 | every batch pays part of a checkpoint |
| DuckDB with the WAL's knobs turned | 14.4 | 27% faster, and 8% smaller on the disk |
| DuckDB with compression off | 19.4 | the write time does not change at all — and the file is 7.6× bigger |
| SQLite | 5.3 | the write is just a WAL append |
Compression is not that account. and the knobs only buy 27%. SQLite is still 2.7× faster. to get faster you have to move the checkpoint off the write path — which is exactly what the export is
Why we gave it up
The owner's own words (2026-12-02):
> 「写 duckdb 的优势是,可以实时联查,而且热数据对磁盘写入量小。」 > > 「写 sqlite 也可以付出不少代价做实时联查;应该写文件是一个量级。」 > > 「写内存是快,但是不可能 hold 太多,hold 少了放 parquet, parquet 碎片化。」
DuckDB today is a good balance — not necessarily the best one, and there may be a better scenario for something else. writing to SQLite is the only option that competes, but the engineering, and the constant exporting to Parquet that it needs, are not small — and in a multi-tenant deployment it may not be the right shape. and the timings are built on "a lot of data arriving in a short time", which the real data flow may not look like. so the hybrid mode is not what we ship
And the six questions that had to be answered before starting it:
| question | why it matters | |
|---|---|---|
| ① | how long does the hot copy stay? | the smaller it is, the faster DuckDB scans it — but the more often the export runs |
| ② | how does the export job run? (how often · which days · is it the same sealing we already have) | the export is "turn the old days into Parquet" — the same job as the cold tier's, only the output differs |
| ③ | how do the two sides join? (the boundary in time) | the reports must not have a seam between the newest in SQLite and the oldest in Parquet |
| ④ | how much does sqlite_scan push down? | it decides the cost of the join: a full scan of the hot file, or only the columns we need |
| ⑤ | does the write side need another engine? | SQLite writes fast but it is a single writer — fine for one collector, not for many |
| ⑥ | what is this to what we have now? | it replaces "one DuckDB hot file + the cold tier's Parquet" with "SQLite hot + Parquet history", so DuckDB steps down from being the storage to being the query engine |
And the two problems that decided it (the owner, 2026-12-05):
- The checkpoint choice matters a lot.. Every knob on DuckDB's side
buys 27% at most. and the export frequency, the hot copy's size and the sealing's cost all have to line up. it is a design with several dials, and each one is a decision
- **SQLite's shortcomings are too obvious for hot data and for custom
queries.. Its reads are 15× slower (a summary: 1,714 ms against DuckDB's 114 ms). and that is not fixable with a knob: indexes cover the regular queries, but a custom query is very hard to accelerate with indexes. and reports are custom queries (any combination of filters and groupings). which is the bill for the assumption that we cannot know what people will ask**
What it was worth, then
The mode did not ship. The idea did.
The experiment is where the sentence came from: the storage problem can be solved by Parquet-ifying it. the hot copy is temporary, the history is Parquet, and the queries run in the columnar engine. that is the cold tier. the hybrid was the road to it
And the SQLite line stayed in the product for the thing it was actually good at: our management metadata. plus the observation that it is the fastest writer we have — which is a fact worth knowing, whatever we build on it
Caveats
The write numbers are one round on one machine (the aligned tier); the memory numbers are another (three years of history, 20,000/s); the export cost is a third (sealing 2,767,665 rows in 10.4 s). Each comparison is inside its own round.
The measuring tools are private; every number here was measured on the machine above, and the method is written down in the post itself.