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.

TL;DR
QuestDB ingests millions of rows per second and queries time-series data with standard SQL plus time-series extensions.
§01

What it is

QuestDB is a fast open-source time-series database built in Java and C++. It ingests millions of rows per second via the InfluxDB line protocol and lets you query with standard SQL extended with time-series functions like SAMPLE BY, LATEST ON, and ASOF JOIN. QuestDB is column-oriented and optimized for append-heavy workloads typical of IoT, financial, and observability data.

QuestDB is designed for engineers building applications that process high-volume time-stamped data: metrics, sensor readings, financial ticks, or application logs.

§02

How it saves time or tokens

Traditional databases struggle with high-frequency inserts and time-range queries over large datasets. QuestDB's column-oriented storage and memory-mapped files provide consistent query performance regardless of data volume. The SQL interface means no new query language to learn. InfluxDB line protocol compatibility lets you point existing Telegraf or vector.dev pipelines at QuestDB without changing your collection layer.

§03

How to use

  1. Start QuestDB with Docker:
docker run -d --name questdb \
  -p 9000:9000 -p 9009:9009 -p 8812:8812 \
  questdb/questdb
  1. Access the web console at http://localhost:9000 and run SQL queries.
  1. Ingest data via InfluxDB line protocol (port 9009):
echo 'sensors,location=office temperature=23.5,humidity=45 1681000000000000000' | \
  nc localhost 9009

Or use the PostgreSQL wire protocol (port 8812) with any Postgres client.

§04

Example

Time-series analysis with QuestDB SQL extensions:

-- Average temperature per hour
SELECT timestamp, avg(temperature) AS avg_temp
FROM sensors
WHERE timestamp > dateadd('d', -7, now())
SAMPLE BY 1h
ALIGN TO CALENDAR;

-- Latest reading per sensor
SELECT * FROM sensors
LATEST ON timestamp PARTITION BY location;

-- Join two time-series by closest timestamp
SELECT s.timestamp, s.temperature, w.wind_speed
FROM sensors s
ASOF JOIN weather w ON (s.timestamp = w.timestamp);
§05

Related on TokRepo

§06

Common pitfalls

  • Using QuestDB for general-purpose OLTP workloads. QuestDB is optimized for append-only time-series data. It does not support UPDATE or DELETE on individual rows in the traditional sense.
  • Not using SAMPLE BY for time-series aggregation. Writing manual GROUP BY with date functions is slower than QuestDB's native SAMPLE BY, which is optimized for time-bucketed queries.
  • Ignoring the designated timestamp column. QuestDB requires a designated timestamp column for time-series features. Without it, SAMPLE BY, LATEST ON, and ASOF JOIN will not work.
  • Starting with an overly complex configuration instead of defaults. Begin with the minimal setup, verify it works, then customize incrementally. This approach catches configuration errors early and keeps troubleshooting straightforward.

Frequently Asked Questions

How fast is QuestDB ingestion?+

QuestDB can ingest millions of rows per second via the InfluxDB line protocol on commodity hardware. Exact throughput depends on row width, hardware, and configuration. The append-only storage model and memory-mapped files enable this performance.

Can I query QuestDB with standard PostgreSQL clients?+

Yes. QuestDB implements the PostgreSQL wire protocol on port 8812. You can connect with psql, DBeaver, or any PostgreSQL driver. Note that QuestDB supports a SQL subset optimized for time-series, not full PostgreSQL compatibility.

Does QuestDB support high availability?+

QuestDB Enterprise supports replication for high availability. The open-source version runs as a single instance. For the open-source version, you handle availability through infrastructure-level redundancy.

How does QuestDB compare to TimescaleDB?+

TimescaleDB extends PostgreSQL with time-series features, giving you full PostgreSQL compatibility. QuestDB is a purpose-built engine with higher raw ingestion speed but a smaller SQL surface area. Choose TimescaleDB for PostgreSQL ecosystem compatibility; choose QuestDB for maximum ingestion throughput.

Can QuestDB handle out-of-order data?+

Yes. QuestDB supports out-of-order ingestion with configurable lag parameters. Data arriving out of timestamp order is merged correctly into the time-series. This is important for IoT and distributed systems where data delivery is not strictly ordered.

Citations (3)

Discussion

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

Related Assets