Convert Figma logo to code with AI

questdb logoquestdb

QuestDB is an open source time-series database for fast ingest and SQL queries

14,292
1,147
14,292
577

Top Related Projects

28,588

Scalable datastore for metrics, events, and real-time analytics

An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.

13,388

Apache Druid: a high performance real-time analytics database.

5,385

Apache Pinot - A realtime distributed OLAP datastore

ClickHouse® is a real-time analytics DBMS

The Prometheus monitoring system and time series database.

Quick Overview

QuestDB is a high-performance, open-source SQL database designed for time-series data. It offers real-time analytics and is optimized for fast ingestion and querying of large-scale time-series datasets. QuestDB combines SQL with time-series extensions, making it suitable for various applications, including financial markets, IoT, and application monitoring.

Pros

  • Extremely fast ingestion and query performance
  • SQL compatibility with time-series extensions
  • Low resource requirements and efficient storage
  • Support for both real-time and historical data analysis

Cons

  • Limited ecosystem compared to more established databases
  • Fewer advanced features compared to some specialized time-series databases
  • Steeper learning curve for users unfamiliar with time-series concepts
  • Relatively young project, which may lead to more frequent changes and updates

Code Examples

  1. Creating a table and inserting data:
CREATE TABLE sensors (
    ts TIMESTAMP,
    sensor_id SYMBOL,
    temperature DOUBLE
);

INSERT INTO sensors
VALUES(systimestamp(), 'sensor1', 25.5),
      (systimestamp(), 'sensor2', 22.3),
      (systimestamp(), 'sensor1', 26.1);
  1. Querying time-series data with aggregation:
SELECT sensor_id,
       avg(temperature) AS avg_temp,
       min(temperature) AS min_temp,
       max(temperature) AS max_temp
FROM sensors
WHERE ts >= dateadd('h', -1, now())
GROUP BY sensor_id;
  1. Using time-series functions:
SELECT ts,
       sensor_id,
       temperature,
       rate(temperature) OVER (PARTITION BY sensor_id ORDER BY ts) AS temp_rate
FROM sensors
WHERE ts >= dateadd('d', -1, now());

Getting Started

To get started with QuestDB:

  1. Download and install QuestDB from the official website or use Docker:

    docker run -p 9000:9000 -p 8812:8812 questdb/questdb
    
  2. Connect to QuestDB using the web console at http://localhost:9000 or use a SQL client with the JDBC driver.

  3. Create a table and insert data:

    CREATE TABLE mytable (ts TIMESTAMP, value DOUBLE) timestamp(ts);
    INSERT INTO mytable VALUES(systimestamp(), 42.0);
    
  4. Query your data:

    SELECT * FROM mytable;
    

For more detailed instructions and advanced usage, refer to the official QuestDB documentation.

Competitor Comparisons

28,588

Scalable datastore for metrics, events, and real-time analytics

Pros of InfluxDB

  • More mature and widely adopted time-series database with a larger community
  • Offers a complete ecosystem with additional tools like Telegraf and Chronograf
  • Supports both SQL-like and functional query languages (InfluxQL and Flux)

Cons of InfluxDB

  • Can be more resource-intensive, especially for large-scale deployments
  • Learning curve for Flux query language can be steep for new users
  • Limited support for JOINs and complex queries compared to traditional SQL databases

Code Comparison

InfluxDB query (using Flux):

from(bucket:"example")
  |> range(start: -1h)
  |> filter(fn: (r) => r._measurement == "cpu")
  |> mean()

QuestDB query (using SQL):

SELECT avg(usage)
FROM cpu
WHERE time > dateadd('h', -1, now());

Both databases excel at handling time-series data, but QuestDB focuses on SQL compatibility and high-performance ingestion, while InfluxDB offers a broader ecosystem and more flexible query options. QuestDB may be easier for SQL-proficient users, while InfluxDB provides more built-in analysis functions and a wider range of integrations.

An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension.

Pros of TimescaleDB

  • Built on PostgreSQL, offering full SQL support and compatibility with existing PostgreSQL tools and extensions
  • Automatic partitioning and chunking of time-series data for improved query performance
  • Advanced features like continuous aggregates and data retention policies

Cons of TimescaleDB

  • Higher resource consumption compared to QuestDB, especially for large datasets
  • More complex setup and configuration process
  • Steeper learning curve for users not familiar with PostgreSQL

Code Comparison

TimescaleDB (SQL):

CREATE TABLE sensors (
  time        TIMESTAMPTZ NOT NULL,
  sensor_id   INTEGER,
  temperature DOUBLE PRECISION,
  humidity    DOUBLE PRECISION
);

SELECT create_hypertable('sensors', 'time');

QuestDB (SQL):

CREATE TABLE sensors (
  time        TIMESTAMP,
  sensor_id   INT,
  temperature DOUBLE,
  humidity    DOUBLE
) timestamp(time);

Both databases use SQL for querying and data manipulation, but QuestDB's syntax is more streamlined for time-series operations. TimescaleDB requires an additional step to create a hypertable, while QuestDB automatically optimizes for time-series data with the timestamp(time) clause.

13,388

Apache Druid: a high performance real-time analytics database.

Pros of Druid

  • More mature project with a larger community and ecosystem
  • Supports a wider range of data ingestion methods and formats
  • Offers advanced features like multi-tenancy and fine-grained security controls

Cons of Druid

  • Higher complexity and steeper learning curve
  • Requires more resources and infrastructure to run effectively
  • Can be slower for certain types of queries compared to QuestDB

Code Comparison

QuestDB SQL query:

SELECT avg(temperature)
FROM sensors
WHERE location = 'New York'
  AND timestamp BETWEEN '2023-01-01' AND '2023-12-31'

Druid SQL query:

SELECT AVG("temperature")
FROM "sensors"
WHERE "location" = 'New York'
  AND "__time" BETWEEN TIMESTAMP '2023-01-01' AND TIMESTAMP '2023-12-31'

Both databases use SQL-like syntax, but Druid uses double quotes for identifiers and has a special __time column for timestamps. QuestDB's syntax is closer to standard SQL.

QuestDB is designed for simplicity and high-performance time-series data processing, while Druid offers more flexibility and features at the cost of increased complexity. The choice between them depends on specific project requirements, scale, and the development team's expertise.

5,385

Apache Pinot - A realtime distributed OLAP datastore

Pros of Pinot

  • Highly scalable and distributed architecture for real-time analytics
  • Supports multiple data ingestion methods (batch, streaming, hybrid)
  • Rich query language with SQL-like syntax and advanced aggregations

Cons of Pinot

  • More complex setup and configuration compared to QuestDB
  • Higher resource requirements for distributed deployment
  • Steeper learning curve for optimization and tuning

Code Comparison

QuestDB:

SELECT avg(temperature)
FROM sensors
WHERE location = 'New York'
  AND timestamp > dateadd('d', -7, now());

Pinot:

SELECT AVG(temperature)
FROM sensors
WHERE location = 'New York'
  AND timestamp > DateAdd('DAY', -7, Now());

Both QuestDB and Pinot support SQL-like queries, making it easy for users familiar with SQL to work with either system. The syntax is very similar, with minor differences in function names (e.g., dateadd vs DateAdd). Pinot's query language offers more advanced features for complex analytics, while QuestDB focuses on simplicity and performance for time-series data.

QuestDB excels in single-node deployments and offers excellent performance for time-series workloads. Pinot, on the other hand, is designed for distributed environments and can handle a wider variety of analytical queries across large datasets. The choice between the two depends on the specific use case, scale requirements, and the complexity of analytics needed.

ClickHouse® is a real-time analytics DBMS

Pros of ClickHouse

  • Highly scalable and distributed architecture, suitable for massive datasets
  • Rich set of SQL features and functions for complex analytics
  • Extensive ecosystem with various integrations and tools

Cons of ClickHouse

  • Steeper learning curve due to its complexity and unique features
  • Higher resource requirements for optimal performance
  • More complex setup and maintenance compared to simpler databases

Code Comparison

ClickHouse SQL example:

SELECT
    toStartOfHour(timestamp) AS hour,
    count() AS count
FROM events
WHERE timestamp >= now() - INTERVAL 1 DAY
GROUP BY hour
ORDER BY hour

QuestDB SQL example:

SELECT
    timestamp_sequence(timestamp, 1h) AS hour,
    count()
FROM events
WHERE timestamp >= dateadd('d', -1, now())
SAMPLE BY 1h ALIGN TO CALENDAR

Both databases offer SQL support for time-series data, but ClickHouse provides more advanced features and functions, while QuestDB focuses on simplicity and ease of use for time-series analytics. ClickHouse is better suited for large-scale distributed deployments, whereas QuestDB excels in single-node setups with lower resource requirements.

The Prometheus monitoring system and time series database.

Pros of Prometheus

  • More mature and widely adopted monitoring system with a large ecosystem
  • Supports a wide range of exporters and integrations
  • Powerful query language (PromQL) for data analysis and alerting

Cons of Prometheus

  • Can be resource-intensive for large-scale deployments
  • Limited long-term storage capabilities without additional components
  • Steeper learning curve for advanced features and configuration

Code Comparison

Prometheus (Go):

func (h *Handler) serveMetrics(w http.ResponseWriter, r *http.Request) {
    metrics.IncrementCounter(metrics.HttpRequestsTotal)
    h.metrics.ServeHTTP(w, r)
}

QuestDB (Java):

public class MetricsPublisher implements Closeable {
    private final MetricRegistry registry;
    private final JmxReporter reporter;

    public MetricsPublisher() {
        this.registry = new MetricRegistry();
        this.reporter = JmxReporter.forRegistry(registry).build();
        this.reporter.start();
    }
}

Both projects use different languages and approaches for metrics handling. Prometheus focuses on HTTP-based metrics collection, while QuestDB utilizes JMX for reporting metrics in a Java environment.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

QuestDB Logo

 

QuestDB open source contributors QuestDB on Apache Maven

English | 简体中文 | 繁體中文 | العربية | Italiano | Українська | Español | Português | 日本語 | Türkçe | हिंदी | Tiếng Việt


QuestDB is the fastest growing open-source time-series database offering blazingly fast, high throughput ingestion and dynamic, low-latency SQL queries. The entire high-performance codebase is built from the ground up in Java, C++ and Rust with no dependencies and zero garbage collection.

We achieve high performance via a column-oriented storage model, parallelized vector execution, SIMD instructions, and low-latency techniques. In addition, QuestDB is hardware efficient, with quick setup and operational efficiency.

QuestDB implements ANSI SQL with native time-series SQL extensions. These SQL extensions make it simple to analyze, filter and downsample data, or to correlate data from multiple sources using relational and time-series joins.

Ready to go? Jump to the Get started section.

 

QuestDB Web Console showing a SQL statement and query result

QuestDB Web Console - click to launch demo

 

Benefits of QuestDB

QuestDB excels with:

  • financial market data
  • IoT sensors with high data cardinality
  • real-time dashboards

Feature highlights include:

  • SQL with powerful, SIMD-optimized time-series extensions
  • High-speed ingestion via the InfluxDB Line Protocol
  • Strong and efficient performance on limited hardware
  • Columnar storage format (native or Apache Parquet), partitioned and ordered by time
  • Responsive and intuitive Web Console for query and data management, with error handling
  • Excellent performance with high data cardinality - see benchmarks

And why use a time-series database?

Beyond performance and efficiency, with a specialized time-series database, you don't need to worry about:

  • out-of-order data
  • duplicates
  • exactly one semantics
  • streaming data (low latency)
  • high volumes of concurrent requests
  • volatile and "bursty" data
  • adding new columns - change schema "on the fly" while streaming data

Try QuestDB, demo and dashboards

The live, public demo is provisioned with the latest QuestDB release and sample datasets:

  • Trips: 10 years of NYC taxi trips with 1.6 billion rows
  • Trades: live crypto market data with 30M+ rows per month
  • Pos: geolocations of 250k unique ships over time

Use example queries or write your own!

The public demo queries over 1.6BN rows and uses a r6a.12xlarge 48 vCPU and 348GB RAM instance.

QueryExecution time
SELECT sum(double) FROM trips0.15 secs
SELECT sum(double), avg(double) FROM trips0.5 secs
SELECT avg(double) FROM trips WHERE time in '2019'0.02 secs
SELECT time, avg(double) FROM trips WHERE time in '2019-01-01' SAMPLE BY 1h0.01 secs
SELECT * FROM trades LATEST ON timestamp PARTITION BY symbol0.00025 secs

We also have some public, real-time demo dashboards using our Grafana-native plugin:

QuestDB performance vs. other oss databases

QuestDB performs very well in performance benchmarks compared to alternatives.

For deep dives into internals and performance, see the following blog posts:

As always, we encourage you to run your own benchmarks.

A chart comparing the ingestion rate of QuestDB, InfluxDB and TimescaleDB.

Get started

Use Docker to start quickly:

docker run -p 9000:9000 -p 9009:9009 -p 8812:8812 questdb/questdb

Or macOS users can use Homebrew:

brew install questdb
brew services start questdb
questdb start
questdb stop

Alternatively, to kickoff the full onboarding journey, start with our concise quick start guide.

First-party ingestion clients

QuestDB clients for ingesting data via the InfluxDB Line Protocol:

Connect to QuestDB

Interact with QuestDB and your data via the following interfaces:

Popular third-party tools

Popular tools that integrate with QuestDB include:

End-to-end code scaffolds

From streaming ingestion to visualization with Grafana, start with code scaffolds in from our quickstart repository.

Configure QuestDB for production workloads

Find our capacity planning to fine-tune QuestDB for production workloads.

QuestDB Enterprise

For secure operation at greater scale or within larger organizations.

Additional features include:

  • multi-primary ingestion
  • read replica(s)
  • cold storage integration
  • role-based access control
  • TLS encryption
  • native querying of Parquet files via object storage
  • support SLAs, enhanced monitoring and more

Visit the Enterprise page for further details and contact information.

Additional resources

📚 Read the docs

❓ Get support

🚢 Deploy QuestDB

Contribute

Contributions welcome!

We appreciate:

To get started with contributing:

✨ As a sign of our gratitude, we send QuestDB swag to our contributors!

A big thanks goes to the following wonderful people who have contributed to QuestDB emoji key:


clickingbuttons

💻 🤔 📓

ideoma

💻 📓 ⚠️

tonytamwk

💻 📓

sirinath

🤔

igor-suhorukov

💻 🤔

mick2004

💻 📦

rawkode

💻 🚇

solidnerd

💻 🚇

solanav

💻 📖

shantanoo-desai

📝 💡

alexprut

💻 🚧

lbowman

💻 ⚠️

chankeypathak

📝

upsidedownsmile

💻

Nagriar

💻

piotrrzysko

💻 ⚠️

mpsq

💻

siddheshlatkar

💻

Yitaek

✅ 💡

gabor-boros

✅ 💡

kovid-r

✅ 💡

TimBo93

🐛 📓

zikani03

💻

jaugsburger

💻 🚧

TheTanc

📆 🖋 🤔

davidgs

🐛 🖋

kaishin

💻 💡

bluestreak01

💻 🚧 ⚠️

patrickSpaceSurfer

💻 🚧 ⚠️

chenrui333

🚇

bsmth

📖 🖋

Ugbot

💬 📓 📢

lepolac

💻 🔧

tiagostutz

📓 🐛 📆

Lyncee59

🤔 💻

rrjanbiah

🐛

sarunas-stasaitis

🐛

RiccardoGiro

🐛

duggar

🐛

postol

🐛

petrjahoda

🐛

t00

🐛

snenkov

📓 🐛 🤔

marregui

💻 🤔 🎨

bratseth

💻 🤔 📓

welly87

🤔

fuzzthink

🤔 📓

nexthack

💻

g-metan

🐛

tim2skew

🐛 📓

ospqsp

🐛

SuperFluffy

🐛

nu11ptr

🐛

comunidadio

🐛

mugendi

🤔 🐛 📖

paulwoods222

🐛

mingodad

🤔 🐛 📖

houarizegai

📖

jjsaunier

🐛

zanek

🤔 📆

Geekaylee

📓 🤔

lg31415

🐛 📆

null-dev

🐛 📆

ultd

🤔 📆

ericsun2

🤔 🐛 📆

giovannibonetti

📓 🐛 📆

wavded

📓 🐛

puzpuzpuz

📖 💻 📓

rstreics

💻 🚇 📖

mariusgheorghies

💻 🚇 📖

pswu11

🖋 🤔 🎨

insmac

💻 🤔 🎨

eugenels

💻 🤔 🚧

bziobrowski

💻 📆

Zapfmeister

💻 📓

mkaruza

💻

DylanDKnight

📓 🐛

enolal826

💻

glasstiger

💻

argshook

💻 🤔 🎨 🐛

amunra

💻 📖 🐛

GothamsJoker

💻

kocko

💻

jerrinot

💻 🤔 🐛

rberrelleza

💻

Cobalt-27

💻

eschultz

💻

XinyiQiao

💻

terasum

📖

PlamenHristov

💻

tris0laris

📝 🤔

HeZean

💻 🐛

iridess

💻 📖

selmanfarukyilmaz

🐛

donet5

🤔 🐛

Zahlii

🐛

salsasepp

🐛

EmmettM

🐛 ⚠️

robd003

🤔

AllenEdison

🐛

CSharpDummy

🐛

shimondoodkin

🐛 🤔

huuhait

🐛 🤔

alexey-milovidov

🐛

suconghou

🐛

allegraharris

💻

oliver-daniel

💻

kerimsenturk5734

📖

This project adheres to the all-contributors specification. Contributions of any kind are welcome!

NPM DownloadsLast 30 Days