ScriptsApr 14, 2026·3 min read

QuestDB — High-Performance Time-Series Database with SQL

QuestDB is a fast open-source time-series database built in Java/C++. It ingests millions of rows per second via InfluxDB line protocol and lets you query with standard SQL plus powerful time-series extensions.

Introduction

QuestDB is the time-series database for people who want extreme ingestion speed without giving up SQL. Benchmarks show 5M+ rows/second ingestion on a single instance and 100x query speedups for aggregations over billions of rows, thanks to a column-oriented storage layout and vectorized execution.

With over 17,000 GitHub stars, QuestDB is used by trading firms, cryptocurrency exchanges, and IoT platforms. It speaks InfluxDB line protocol (for easy migration) and the Postgres wire protocol (use psql/JDBC drivers).

What QuestDB Does

Data is partitioned by time on disk and stored column-by-column. SQL queries run through a vectorized engine that streams columns in L1/L2-friendly chunks. ILP (InfluxDB Line Protocol) over TCP/UDP handles high-rate ingestion, and the Postgres wire protocol lets any SQL client connect unmodified.

Architecture Overview

Clients                              Protocols
  psql / JDBC / ODBC         <--->   Postgres wire (8812)
  InfluxDB line (Telegraf)   --->    ILP TCP/UDP (9009)
  HTTP / SDK                 <--->   REST + InfluxDB v2 (9000)
        |
   [QuestDB Engine (Java + C++/Rust hot paths)]
        |
  [WAL (write-ahead log)]
   asynchronous durability
        |
  [Column Store]
   per-column files
   partitioned by time (DAY/HOUR/MONTH)
        |
  [Vectorized Query Executor]
   SIMD-friendly scans
   late materialization

Self-Hosting & Configuration

# Ingest via InfluxDB line protocol (from anywhere)
echo "cpu,host=web1 usage=0.37 $(date +%s%N)" | nc -u localhost 9009

# Or Python client
pip install questdb
python - <<'PY'
from questdb.ingress import Sender, TimestampNanos
import datetime
with Sender('localhost', 9009) as s:
    s.row(
        'trades',
        symbols={'symbol': 'BTC-USD'},
        columns={'price': 65000.0, 'size': 0.5},
        at=TimestampNanos.now(),
    )
    s.flush()
PY
-- Downsampling via SAMPLE BY + FILL to cover gaps
SELECT ts, symbol, avg(price) AS avg_price
FROM trades
WHERE ts > dateadd('d', -7, now())
SAMPLE BY 5m FILL(PREV);

-- Join time series with relational data
SELECT t.ts, t.symbol, t.price, a.ceo
FROM trades t
LEFT JOIN assets a ON a.symbol = t.symbol
WHERE t.ts IN '2026-04-14';

Key Features

  • Extreme ingestion — millions of rows/second via ILP
  • SQL-native — standard SQL + time-series extensions (SAMPLE BY, LATEST ON)
  • Postgres wire protocol — use any SQL client/driver unchanged
  • Column store — partitioned by time for fast range scans
  • Vectorized execution — SIMD-friendly query operators
  • WAL durability — fsync-based write-ahead log with async commits
  • InfluxDB v2 API — drop-in replacement for many Telegraf/Grafana setups
  • Enterprise features — replication, auth, row-level security (commercial)

Comparison with Similar Tools

Feature QuestDB InfluxDB TimescaleDB ClickHouse VictoriaMetrics
Query language SQL Flux / InfluxQL SQL SQL PromQL/MetricsQL
Ingestion speed Very High High High Extreme Very High
Storage Columnar TSM Row + compressed Columnar (MergeTree) TSM-like
Postgres wire Yes No Yes (it is Postgres) No No
Join with relational Yes No Yes Yes Limited
Best For Trading / finance Metrics ecosystem Postgres shops Analytics at scale Prometheus

FAQ

Q: QuestDB vs TimescaleDB? A: TimescaleDB sits inside Postgres — richer relational features, broader ecosystem. QuestDB is a purpose-built TSDB — higher raw ingestion and faster time-range scans. For trading workloads, QuestDB often wins benchmarks.

Q: Can I use QuestDB with Grafana? A: Yes. Use either the Postgres data source (via port 8812) or the QuestDB-specific plugin for richer features like LATEST ON visualizations.

Q: Is QuestDB truly open source? A: Yes, Apache-2.0 for the core. Replication, RBAC, and object-store cold tier are available in QuestDB Enterprise (paid).

Q: What about writes vs reads? A: QuestDB is optimized for write-heavy workloads with analytical reads over time ranges. OLTP workloads (many small updates/deletes) are not its strength — use Postgres/TimescaleDB for those.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets