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.
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.
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.
How to use
- Start QuestDB with Docker:
docker run -d --name questdb \
-p 9000:9000 -p 9009:9009 -p 8812:8812 \
questdb/questdb
- Access the web console at
http://localhost:9000and run SQL queries.
- 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.
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);
Related on TokRepo
- Database tools — Browse database solutions
- Monitoring tools — Explore observability and monitoring tools
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
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.
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.
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.
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.
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)
- QuestDB GitHub— QuestDB is a high-performance time-series database
- QuestDB Documentation— SQL extensions for time-series analysis
- QuestDB ILP Docs— InfluxDB line protocol support
Related on TokRepo
Discussion
Related Assets
Moodle — Open-Source Learning Management System
The most widely used open-source learning platform, providing course management, assessments, and collaboration tools for educators and organizations worldwide.
Sylius — Headless E-Commerce Framework on Symfony
An open-source headless e-commerce platform built on Symfony and API Platform, designed for developers who need a customizable and API-first commerce solution.
Akaunting — Free Self-Hosted Accounting Software
A free, open-source online accounting application built on Laravel for small businesses and freelancers to manage invoices, expenses, and financial reports.