Why four backends — DuckDB, ClickHouse, PostgreSQL, SQLite

We ship four storage backends. That is not a menu — it is **two lines that matter and two that exist because of where you already are.** This is what each one is for, what it costs, and what we found on the way.

The four, measured

One round, one machine, the same rows (1,000,000 visits · 2,767,665 rows):

on the diskper viewbulk write100 small batchessummarytop pages
our DuckDB + Parquet cold tier50.8 MB21 B35.1 s88.1 s114 ms25 ms
our ClickHouse65.7 MB27 B43.1 s1,025.2 s20 ms19 ms
our DuckDB (hot tier only)121.4 MB50 B20.6 s98.2 s87 ms10 ms
plausible CE (ClickHouse)92.3 MB38 B26.6 s889.5 s17 ms17 ms
our SQLite1,072.0 MB439 B4.9 s23.7 s1,714 ms470 ms
our PostgreSQL1,110.6 MB455 B11.0 s58.3 s1,860 ms295 ms
umami v3 (PostgreSQL)3,406.0 MB1,396 B87.1 s112.2 s996 ms1,995 ms

Two of these are the product's line: DuckDB and ClickHouse. the other two exist because of where you already are. and the numbers say what each of those costs

The core line: DuckDB → ClickHouse, without rewriting anything

The path we mean to walk a customer along:

  1. DuckDB — a single file, no server to run, enough for a mid-sized site

, so 121.4 MB for a million visits, and the write path is the fastest of the column stores we have.

  1. ClickHouse — when the site grows, the same rows in ClickHouse cost

65.7 MB (the same order) and the reads are 5–6× faster (20 ms against 114 ms for a summary).

The migration is a change of backend, not a rewrite. because the shape is written once (the same schema, the same reports, the same numbers — the conformance tests prove it). and the cold tier's Parquet is a standard table that either engine can read

And the trade on the way up is real: ClickHouse's small-batch write is 1,025 s against DuckDB's 88 s. that is the bill for growing — and it is worth paying only when the reads are the thing that hurts

PostgreSQL: because you already have one

The reason it is there: the customer's cluster is already running. Asking somebody to run a second database because ours is nicer is a bad trade.

But the data says what it costs:

on the disk
our PostgreSQL backend1,110.6 MB
our DuckDB + cold tier50.8 MB
21.9×

That gap is the columnar advantage, and it comes from one property: append-only data.. In a row store every row carries its own overhead (header, null bitmap, alignment) and the same value repeated in a column is stored again and again. In a column store the repetition is what the compressor eats. and an event table is append-only by nature. we are not wasting anything on a general-purpose engine's flexibility — we are paying for the flexibility we do not use

. We will look at whether PostgreSQL can do better. That door is open, and nothing here says the answer is "no" — it says the answer is 21.9× today

SQLite: it came in for the metadata, and then it surprised us

The reason it is there: our management metadata lives in SQLite. That is how it got in — and then the experiments found something else:

the writethe peak memory under load
SQLite5.3 µs/row33 MB
DuckDB19.6 µs/row214 MB

SQLite writes three and a half times faster and holds six times less memory. and on the full traffic: the write is 3.2–4.2× faster than DuckDB's (4,634 ms against 19,352 ms for the bulk load; 24,747 ms against 78,837 ms for the small batches). but its reads are 15× slower (summary 1,714 ms against 114 ms). which is the whole trade in two numbers

And that is where the idea came from: if the write is that good and the read is that bad, then the storage can be Parquet-ified. the history becomes Parquet (columnar, compressed, standard) and only the hot days stay in the row store. and the queries run in the columnar engine, over both

sumimi-lite, the experiment (its own article)

Write in SQLite · export the history to Parquet · query with DuckDB over both. that experiment is its own article: SQLite writes fast and uses less memory — and we still gave up the sumimi-lite plan. there are its three numbers (writes 3.2–4.2× faster · six times less memory · the history 52.9 MB read in 0.03 s), its mechanism (the export is the checkpoint) and the two reasons it was dropped

One line here: the mode did not ship, but "the storage can be solved by Parquet-ifying it" came from it — and that became the cold tier

Where each line stands

linewhy it is therewhat it costs
DuckDBthe starting point of the core line: one file, no server, enough for a mid-sized sitethe reads are 5–6× slower than ClickHouse's; the hot tier alone is 121.4 MB
ClickHousethe growing end of the core line: the same rows, 65.7 MB, and reads 5–6× fasterthe small-batch write is 12× slower (1,025 s against 88 s)
PostgreSQLyou already run one21.9× the storage of our DuckDB tier; the reads are 16× slower than DuckDB's
SQLiteour management metadata lives there — and it is the fastest writer we havethe reads are 15× slower; indexes cannot save a custom query

What we take away

  1. Four backends is not a menu: two lines and two accommodations. The core

line is DuckDB → ClickHouse, and the move between them is a change of backend, not a rewrite — because the shape is written once.

  1. The other two exist because of where you already are, and the numbers

say what they cost: 21.9× the storage for PostgreSQL, 15× slower reads for SQLite.

  1. **The reason columnar wins here is not fashion — it is that event data is

append-only**, and that is exactly the shape a column store's compression eats.

  1. The experiment that did not ship is still worth having: SQLite's write

and memory numbers are what told us the storage could be Parquet-ified. and that became the cold tier. the hybrid was the road to it

Caveats

The four-way table is one round on one machine (the scoreboard's tier: 1,000,000 visits · 2,767,665 rows). The write measurements are from another round, and the memory numbers from a third (three years of history, 20,000/s) — each comparison is inside its own round, and the rounds are not interchangeable.

The measuring tools are private; every number here was measured on the machine above, and the method is written down in the post itself.

Sumimi / 数咪咪 is an independent open-source project. It is an open-source alternative to Umami and implements the Umami v2 HTTP API; no Umami assets are used. Licensed under the Apache-2.0 licence. Third-party names are referenced nominatively.