Mirexa against ClickHouse, QuestDB, TimescaleDB, InfluxDB 1, 2 and 3, TimeBase, and plain Parquet files queried with DuckDB, each at its defaults and with the tuning that proved itself, on one cloud machine: the same ten million candles and the same ten million trades, the same batches and the same queries, and then the same corrections to bars already stored.
Every knob below came from the system's own documentation, source or engineering blog, researched for this workload and this machine. Then each knob was tested alone against stock: full-size durable runs with queries, three per configuration (InfluxDB 3: one), in a rotating order. Candles and trades were tuned separately, because what suits one-minute bars need not suit irregular nanosecond trades.
A knob was kept only if its median beat stock's by more than 10% on at least one measure, and made none of ingest, table size and the two small reads more than 10% worse. A difference counted only if it was also larger than stock's own spread across its runs, because a millisecond read moves 20–40% between identical runs on this machine. The kept knobs are each system's "tuned" configuration; a system where nothing passed ran stock only.
In the tables, green is better than stock by more than the bar, red is worse by more than the bar, and grey is inside the noise. Each figure is the change against stock: higher throughput, smaller sizes and shorter latencies all read as positive.
ClickHouse's 50 ms async inserts cost 33% of trade ingest in their A/B, and were kept. Stock ClickHouse's own trade ingest moved ±38% across its three runs, so a 33% loss did not count as worse, while the knob's +27% on the whole-symbol read was beyond that read's ±26% spread. On candles the same knob was dropped for its ingest. The rule is applied as written rather than overruled after the fact; what the four kept knobs did together is in the trades table above.
Three candle knobs did what they are for and paid for it elsewhere, so the rule dropped them. Someone who cares more about the measure they improve should turn them on.
Eight storage systems, and plain Parquet files as a ninth, each given the same ten million candles and, separately, the same ten million trades, with the same batches and the same queries, one system at a time on the same machine, each from an empty data directory. Every database except Mirexa ran from its official Docker image on the host network; Mirexa was built from source and ran as a native process. Parquet has no server: the files are written and queried by DuckDB embedded in the load generator, the way an application that keeps its data as files would.
TimeBase speaks only its own protocol, with clients for Java, Python and C++ and none for Go, so its runs go through a Java client in this repository (bench/compare/tbbench) instead of the Go load generator. It reads the same generated records from a file, byte for byte, and runs the same writers, batches, queries and checks, on the load generator's core.
One difference in how TimeBase is loaded: each of its writers sends its symbols merged into one feed in time order, where every other system receives each symbol's history a batch at a time. TimeBase's loader documentation says data that goes symbol by symbol "violates time ordering required by tickdb". Loaded symbol by symbol, it loaded 2.9–3.5× slower, and in one of two runs answered 2 of 300 one-day reads short (494 and 1,098 bars of 1,440); every row was stored, and the full count and every whole-stream read were right. The writers, the symbols each one owns and the 10,000-message batches are the same either way.
Each system ran at its defaults ("stock") and, where tuning passed the test described below, with that tuning ("tuned"). Mirexa ran at its defaults only: it has no codec, index or schema options of the kind the others were tuned on.
| System | Version | Durable run | Relaxed run | Writes | Reads |
|---|---|---|---|---|---|
| Mirexa | native, built from source at the commit each tab names | wal.sync_policy: always (the default) | sync_policy: interval | its binary wire protocol through the Go SDK | the same protocol, rows decoded by the SDK |
| ClickHouse | 25.8.33.6 | fsync_after_insert=1, fsync_part_directory=1 | default | HTTP; TSV text (stock) or Native columnar binary (tuned) | HTTP, RowBinary |
| QuestDB | 10.1.0 (pinned) | QDB_CAIRO_COMMIT_MODE=sync | default | InfluxDB line protocol over HTTP | PostgreSQL wire protocol (pgx) |
| TimescaleDB | 2.31.0 on PostgreSQL 17.11 | default (synchronous_commit=on) | synchronous_commit=off | PostgreSQL COPY (pgx) | PostgreSQL wire protocol (pgx) |
| InfluxDB 1 | 1.11.8 | default (WAL fsync delay 0) | wal-fsync-delay=100ms | line protocol over HTTP | InfluxQL, CSV replies |
| InfluxDB 2 | 2.7.12 | default | storage-wal-fsync-delay=100ms | line protocol over HTTP | InfluxQL (v1 compatibility), CSV replies |
| InfluxDB 3 Core | 3.12.1 | default (no no_sync) | no_sync=true per write | line protocol over HTTP | SQL, CSV replies |
| Parquet + DuckDB | DuckDB 1.4.1, in process | the file and its directory fsynced before the write returns | no fsync | one Parquet file per request, in a directory per symbol (DuckDB's appender, then COPY … TO) | DuckDB SQL over read_parquet of the symbol's files, rows scanned through Go's database/sql |
| TimeBase CE | 6.2.34 | default: each flush waits for the server's acknowledgement (Durability, below) | the same: it has no setting for either | its dxtick protocol through its Java client: one loader per writer, flushed every 10,000 messages | cursors through the Java client, every message decoded; QQL for the rollups |
Every number on this page comes from one cloud machine that ran nothing but the benchmark. It is a small machine: four shared virtual CPUs on an Intel Xeon from 2016, and a virtual disk. Every system's absolute numbers are lower than on a modern laptop; the comparison between them is what the page is for. The database was pinned to three cores and the load generator to the fourth, so the two never competed for a core. Parquet's runs are the exception: DuckDB runs inside the load generator, so those runs had all four cores, the database's three and the client's one.
Shared CPU. The droplet's vCPUs are shared with other customers' machines, so a neighbour can take CPU time away ("steal"). It was logged every five seconds for the whole series and stayed low (above). The disk varied over the day: a synchronous 4 KiB write took 2.1–2.4 ms at the starts of the series. Every system in one repeat ran within the same hour or so, and the order of stock and tuned runs alternated between repeats, so the variation falls on all of them alike.
Two workloads, each loaded into an empty system and then read:
Every system receives byte-identical records in the same order. Each run then goes through these steps:
Relaxed runs measure the load only: reads do not depend on whether writes were fsynced.
A third workload changes data already stored. Market data is corrected after the fact: a vendor republishes a day of bars with fixed prices or late volume. After the same ten-million-candle load, each system restated 288,000 bars it already held: four one-day blocks of each of the 50 streams (the newest day, which a live system may still hold in memory, and three older days chosen at random, the same days for every system), one day of 1,440 bars per request, from 8 writers, durable. Every corrected bar differs from the one it replaces (five cents on each price, one more unit of volume).
Each system changed its rows the way its own documentation says to, with its table declared as an application expecting corrections would declare it:
DEDUP UPSERT KEYS(timestamp, symbol), and the corrected rows are written again over line protocol; a row with the same keys replaces the stored one.ReplacingMergeTree ordered by symbol and time; the corrected rows are inserted again, and every read and count says FINAL, because until a background merge runs the old row stands beside its replacement.UPDATE … FROM in one transaction, checking that exactly 1,440 rows changed.Each run measured, in order: the load into that table; reads of the restated days, the newest 100 bars and a whole stream, after one untimed round so the reads are warm; the corrections, as rows per second and per-request acknowledgement latency; how long after the last acknowledgement a check of all 200 restated days first found every bar exactly once with its corrected close, and the row count still ten million; the same reads again; and, 60 s later, the table on disk. One configuration per system: tuned where the candle tuning kept knobs, otherwise stock; no knob was tested on this workload.
The last workload reads several symbols in one query, as a backtest, a market replay or a screen of prices does. After the same load, durable, each system answered two kinds of query, every answer checked against the generated data:
Each system used its own way of asking: SQL symbol IN (…) ORDER BY time (ClickHouse, QuestDB, TimescaleDB), QuestDB's LATEST ON, ClickHouse's argMax and PostgreSQL's DISTINCT ON for snapshots, InfluxQL without GROUP BY, which merges series by time, a union of each symbol's Parquet files ordered by DuckDB, one TimeBase cursor over all the symbols (reversed for a snapshot), and one Mirexa request naming every symbol, whose per-symbol answers the client merges into time order inside the timing. Each query type ran 300 times or 15 s, whichever came first. One configuration per system, tuned where tuning kept knobs; InfluxDB 3 Core was not run on this workload.
A reviewer pointed out three ways the workloads above favour Mirexa: the reads are short, where a backtest scans history in bulk; every read runs warm, minutes after the load; the most clients is 8; and the table is small and fresh. Four more workloads answer them, each after the same load, durable, in one configuration per system (tuned where tuning kept knobs), InfluxDB 3 Core not run:
compression.algorithm: none (candles at 48 bytes, trades at 24 bytes uncompressed), in the backtests and cold reads for both workloads and on the 100M-row candle table. Default Mirexa, uncompressed Mirexa and QuestDB ran back to back within each of 3 repeats, because the machine's speed drifts by more than 50% between days, so these three are comparable with each other and not with the other tabs. Its results stay out of the overall score.influxd in the runs whose logs were checked. TimeBase CE was not run: its benchmark client holds every row in memory, about 6.4 GB at this size. The backtest scans were not run at this size either.The same reviewer called the Parquet setup a worst case, a directory of small files per symbol, so two more configurations joined every workload: Parquet, compacted (after the load each symbol's files are rewritten as one file in time order, fsynced and renamed into place) and a DuckDB table (the same rows appended into a DuckDB database, then rebuilt sorted by symbol and time and checkpointed).
Durable means that when a system acknowledges a write, the write has been fsynced to disk: a power cut after the acknowledgement cannot lose it. Relaxed means the system may acknowledge before that. Each system was given its own switch for each mode (the table at the top).
A setting's name is not proof of what it does, so the durable runs were audited. Each system loaded 400,000 rows in 40 durable requests while the kernel counted every fsync, fdatasync, sync_file_range, msync and syncfs call, by process (bpftrace on the benchmark machine).
| System | Sync calls by the database for 40 durable requests | Acknowledged writes on disk? |
|---|---|---|
| Mirexa | 151 fsync | yes |
| ClickHouse | 483 fdatasync stock; 72 with async inserts, which group several requests into one part (the inserting thread changes, the guarantee does not) | yes |
| QuestDB | hundreds of fsync and msync | yes |
| TimescaleDB | about 500 fsync/fdatasync, plus sync_file_range | yes |
| InfluxDB 1 and 2 | 61–468 fsync/fdatasync | yes |
| InfluxDB 3 Core | 0 | no |
| Parquet + DuckDB | 88 fsync, called by the harness itself: one per file, one per directory entry, and eight for the new symbol directories | yes |
| TimeBase CE | 1,158 fsync for a whole ten-million-candle load of about 1,000 flushes (1,132 by its file writer thread); its client has no 400,000-row mode | its data files are synced, about once per flush; whether a flush's acknowledgement waits for its sync was not measured |
The audit loaded candles. Each system writes trades through the same durable path its candles take (the same log, the same commit), so the result is expected to carry over to trades; it was not measured separately.
InfluxDB 3 Core acknowledges a durable write once its write-ahead log file has been written through the object_store library's local-file backend, and that backend does not fsync (influxdata/arrow-rs-object-store#2; influxdata/influxdb#26970 reports empty log files after a power loss). No setting in Core turns a sync on. Its "durable" figures are therefore page-cache writes, and the Results tab flags them and leaves them out of every comparison.
Every number is end to end: the load generator encodes each request, sends it, and for reads decodes every row of the reply into numbers (a timestamp and five prices). That client work is part of what an application pays, so it is part of the measurement. It runs on one core, so it must never be the bottleneck in a way that is a fault of the harness rather than of the protocol.
Two faults were found and fixed before any number on this page was taken.
Each run records the client's own CPU use. During the durable load it stayed at or below 0.75 of its core for every system, and during reads at or below 0.77. In relaxed runs, stock ClickHouse (0.96) and QuestDB (0.83) came close to filling it, because formatting ten million rows as text is expensive: their relaxed figures are partly the speed of producing text, which a real application with more client cores would spread out.
bench/compare/decide.py).Trades were tuned on their own, with a separate A/B on the trade workload, because a knob that suits one-minute bars need not suit irregular nanosecond trades. The knobs carry over with three differences. ClickHouse's time column takes Delta + ZSTD instead of DoubleDelta, which assumes a constant stride. TimescaleDB's trade table has one-hour chunks, so compression covers every chunk but the newest hour's. Two knobs do not apply: second-precision timestamps would truncate nanosecond trades, and a 52-week InfluxDB shard changes nothing when 2.8 hours of trades already fit one 7-day shard.
One recommendation was re-measured before it was decided: InfluxDB's 52-week shard looked larger 30 s after the load, which could have been compaction still running, so its size was measured again after five minutes. The difference held. The Tuning tab has every knob, its measured effect and its verdict.
--force-snapshot-max-age 1m, which changes when Parquet is written, not what is written, read five minutes after the load.Everything is in bench/compare on the bench-tuned-vs-stock branch. On a Linux machine with Docker and Go:
KNOBS=ch_native ./run.sh clickhouse durable runs one configuration; TUNED=1 runs a system's kept knobs.REPS=5 DB_CPUS=0-2 CLIENT_CPUS=3 ./series.sh runs the whole stock-against-tuned series; FROM=n resumes it. WORKLOAD=ticks runs the trade series and WORKLOAD=updates the corrections; MULTI=1 runs only the multi-symbol queries, over candles or, with WORKLOAD=ticks, trades. series/pipeline-reviewer-backtest.sh, -cold.sh, -sweep.sh and -aged.sh run the backtest, cold-read, many-client and 100M-row workloads; KNOBS=pq_compact ./run.sh parquet durable runs compacted Parquet and ./run.sh duckdb durable the DuckDB table. TimeBase's runs build its Java client in a Maven container the first time.python3 decide.py results-tune applies the knob rule to an A/B; python3 final_table.py results-final prints the tables; python3 report.py --final … --tune … --shard … builds this page.TUNING.md records the research behind every knob and the full verdicts.The raw result files, including every query's latency samples, are kept outside the repository.
From each project's documentation, not measured here, except the fsync row, which the durability audit in the Methodology tab measured.
| Mirexa | ClickHouse | QuestDB | TimescaleDB | InfluxDB 1 | InfluxDB 2 | InfluxDB 3 Core | Parquet + DuckDB | TimeBase CE | |
|---|---|---|---|---|---|---|---|---|---|
| Query language | binary range, latest-N, rollup and multi-range requests | SQL | SQL | SQL (Postgres) | InfluxQL | Flux, InfluxQL | SQL, InfluxQL | SQL (DuckDB) | QQL |
| Server-side rollups | bars of any length at query time, from candles or from trades | GROUP BY | SAMPLE BY | time_bucket | GROUP BY time | aggregateWindow | date_bin | GROUP BY, in the application's process | QQL OVER TIME |
| Stored rollups, kept up to date | derived streams: trades to bars, bars to longer bars, written as data arrives or re-derived from history | materialized views | materialized views | continuous aggregates | continuous queries | tasks | Python plugins (processing engine) | no | not in its documentation; a LIVE query computes bars as data arrives, stored nowhere |
| Acknowledged write is fsynced, as shipped | yes | no (fsync_after_insert off) | no (commit mode nosync) | yes | yes (WAL fsync delay 0) | yes | no: 0 sync calls measured; no setting turns one on | the application's job (this harness fsyncs each file) | data files synced, about once per flush; ack ordering not measured |
| Market closed vs data lost | recorded per hole at write time; a closure cannot be filled | absent rows; WITH FILL at query time | absent rows; FILL invents values at query time | absent rows; time_bucket_gapfill at query time | absent rows; fill() | absent rows; fill() | absent rows; date_bin_gapfill | absent rows | absent rows |
| Restating a stored bar | a patch chunk over the flushed chunk; each later correction folds in the earlier ones | ReplacingMergeTree, or ALTER … UPDATE | DEDUP UPSERT KEYS on the table | UPDATE | a write to the same series and time replaces it | same as 1 | same as 1 | rewrite the file, or a table format (Iceberg, Delta Lake) | the loader's default (REWRITE) truncates from the first new message's time; INSERT adds without truncating |
| Push new rows to a client | SUBSCRIBE: history, then live | no | no | logical replication, not a client feed | server-side write forwarding only | no | no | no | LIVE queries and cursors: history, then live |
| Replication in the free edition | primary and copies, automatic failover (off by default) | ReplicatedMergeTree with Keeper | Enterprise | Postgres streaming replication | Enterprise | no | Enterprise | none: copying files is the application's job | a replication tool copies streams to another server or to files |
| Licence | this repository | Apache 2.0 | Apache 2.0 | Apache 2.0 core; some features under the Timescale License | MIT | MIT | MIT or Apache 2.0 | Apache 2.0 (Parquet), MIT (DuckDB) | Apache 2.0 |