docker.recipes

QuestDB

beginner

High-performance time-series database with SQL support and built-in web console.

Overview

QuestDB is a high-performance, open-source time-series database engineered for fast ingestion and real-time analytics on time-series data. Developed with a focus on speed and efficiency, QuestDB combines the familiar SQL interface with specialized time-series functions, making it accessible to developers while delivering exceptional performance. The database architecture is built from the ground up in Java and C++ to handle millions of rows per second ingestion with sub-millisecond query latencies, positioning it as a modern alternative to traditional time-series databases. This QuestDB deployment exposes multiple protocols and interfaces to maximize integration flexibility and data ingestion speed. The configuration provides access to QuestDB's web-based console for interactive SQL queries, PostgreSQL wire protocol compatibility for existing applications, InfluxDB line protocol support for high-throughput data ingestion, and a REST API for HTTP-based interactions. This multi-protocol approach allows QuestDB to serve as a drop-in replacement for various database scenarios while maintaining its time-series optimization advantages. Developers building IoT applications, DevOps teams managing monitoring infrastructure, financial institutions processing market data, and data engineers handling large-scale analytics workloads will find this QuestDB deployment particularly valuable. The combination of SQL familiarity, multiple ingestion protocols, and built-in visualization tools makes it ideal for teams transitioning from traditional databases to time-series optimized solutions without sacrificing ease of use or requiring extensive application rewrites.

Key Features

  • Native SQL support with time-series specific functions and SAMPLE BY clauses for temporal aggregations
  • Multi-protocol data ingestion supporting InfluxDB line protocol, PostgreSQL wire protocol, and REST API
  • Built-in web console with interactive SQL editor, query visualization, and real-time data exploration
  • Column-oriented storage engine optimized for time-series data compression and query performance
  • SIMD-optimized query execution delivering sub-millisecond response times for analytical queries
  • Automatic data partitioning by time intervals with configurable retention policies
  • Lock-free concurrent writers enabling millions of rows per second ingestion rates
  • Built-in monitoring and metrics accessible through the web interface for performance tracking

Common Use Cases

  • 1IoT sensor data collection and real-time monitoring dashboards for industrial automation systems
  • 2Application performance monitoring (APM) and infrastructure metrics storage for DevOps teams
  • 3Financial market data ingestion and algorithmic trading systems requiring low-latency queries
  • 4Time-series analytics for e-commerce platforms tracking user behavior and conversion metrics
  • 5Energy sector monitoring for smart grid data analysis and predictive maintenance systems
  • 6Cryptocurrency trading platforms requiring high-frequency price data storage and analysis
  • 7Gaming analytics platforms collecting player behavior data and real-time performance metrics

Prerequisites

  • Docker Engine 20.10+ and Docker Compose V2 for container orchestration support
  • Minimum 2GB RAM allocation for QuestDB container with 4GB+ recommended for production workloads
  • Available ports 8812, 9000, 9003, and 9009 for PostgreSQL, web console, REST API, and InfluxDB protocols
  • Basic SQL knowledge for querying time-series data and understanding temporal functions
  • Understanding of time-series data concepts including timestamps, measurements, and aggregation patterns
  • Sufficient disk space for data persistence with consideration for QuestDB's column storage format

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 questdb:
3 image: questdb/questdb:latest
4 container_name: questdb
5 restart: unless-stopped
6 volumes:
7 - questdb_data:/var/lib/questdb
8 ports:
9 - "9000:9000"
10 - "9009:9009"
11 - "8812:8812"
12 - "9003:9003"
13 networks:
14 - questdb-network
15
16volumes:
17 questdb_data:
18
19networks:
20 questdb-network:
21 driver: bridge

.env Template

.env
1# QuestDB requires no configuration

Usage Notes

  1. 1Docs: https://questdb.io/docs/
  2. 2Web console at http://localhost:9000 - run SQL queries directly
  3. 3PostgreSQL wire protocol on port 8812 - use psql or any PG client
  4. 4InfluxDB line protocol on port 9009 for high-speed ingestion
  5. 5REST API on port 9003 for HTTP-based queries
  6. 6Handles millions of rows/sec ingestion with sub-ms queries

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 questdb:
5 image: questdb/questdb:latest
6 container_name: questdb
7 restart: unless-stopped
8 volumes:
9 - questdb_data:/var/lib/questdb
10 ports:
11 - "9000:9000"
12 - "9009:9009"
13 - "8812:8812"
14 - "9003:9003"
15 networks:
16 - questdb-network
17
18volumes:
19 questdb_data:
20
21networks:
22 questdb-network:
23 driver: bridge
24EOF
25
26# 2. Create the .env file
27cat > .env << 'EOF'
28# QuestDB requires no configuration
29EOF
30
31# 3. Start the services
32docker compose up -d
33
34# 4. View logs
35docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/questdb/run | bash

Troubleshooting

  • Web console showing 'Connection refused' at localhost:9000: Verify container is running and port mapping is correct, check Docker logs for QuestDB startup errors
  • High memory usage during large data ingestion: Increase Docker container memory limits and configure QuestDB's cairo.sql.copy.buffer.size for optimal performance
  • PostgreSQL client connection failures on port 8812: Ensure client supports PostgreSQL wire protocol v3 and check for firewall blocking the connection
  • InfluxDB line protocol ingestion errors on port 9009: Validate line protocol format syntax and check QuestDB logs for parsing errors or schema conflicts
  • Slow query performance on large datasets: Verify proper timestamp indexing, consider data partitioning strategies, and optimize WHERE clauses for time ranges
  • Container fails to start with permission errors: Check volume permissions for questdb_data and ensure Docker daemon has write access to the mount point

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space