What is a Time-Series Database?
A time-series database is optimized for storing and querying data that changes over time. Unlike traditional relational databases, time-series databases are purpose-built to handle:- High ingestion rates (millions of rows per second)
- Time-ordered data with timestamps
- Analytical queries over large time ranges
- Time-based aggregations and windowing
Why QuestDB?
QuestDB combines the performance characteristics of specialized time-series databases with the familiar SQL interface that developers already know. It’s designed for applications that generate continuous streams of data:- IoT sensor networks
- Financial market data
- Application metrics and observability
- Network monitoring
- Industrial telemetry
Core Design Principles
Zero-GC Architecture
QuestDB’s Java implementation uses off-heap memory management to avoid garbage collection pauses on data paths. The storage engine operates directly on memory-mapped files with zero allocation during query execution or data ingestion.Column-Oriented Storage
Data is stored by column rather than by row, enabling:- Better compression: Similar values compress more efficiently
- SIMD operations: Vectorized processing of columnar data via native code
- Efficient column scans: Read only the columns needed for a query
- Cache locality: Sequential memory access patterns
TableReader class manages column-oriented reads:
Native Performance
Critical operations use C/C++ implementations with SIMD acceleration:- Vector math operations
- String matching and comparison
- Compression/decompression
- Memory management
Time-Based Partitioning
Tables are automatically partitioned by time intervals (HOUR, DAY, WEEK, MONTH, YEAR), enabling:- Efficient time-range queries
- Parallel query execution across partitions
- Data lifecycle management (TTL)
- Reduced I/O for bounded queries
Performance Characteristics
Write Performance
QuestDB achieves high write throughput through:- Append-only writes: Data is always appended to the end of column files
- Batch commits: Multiple rows are committed in a single transaction
- WAL (Write-Ahead Log): Decouples ingestion from table updates for concurrent writes
- O3 (Out-of-Order) support: Handles late-arriving data efficiently
Read Performance
Queries execute efficiently via:- Time-based partition pruning: Skip partitions outside the query range
- Columnar scans: Read only required columns
- Parallel execution: Multi-threaded query processing
- JIT compilation: Just-in-time compilation of filter expressions
- SIMD operations: Vectorized aggregations
SQL Extensions for Time-Series
QuestDB extends standard SQL with time-series specific features:- SAMPLE BY: Time-based aggregations (downsampling)
- ASOF JOIN: Join tables by nearest timestamp match
- LATEST ON: Deduplicate by timestamp to get latest values
- WINDOW JOIN: Range-based joins with time windows
- HORIZON JOIN: Aggregate over future time ranges with ASOF lookups
Comparison with Traditional Databases
| Feature | Traditional RDBMS | QuestDB |
|---|---|---|
| Storage model | Row-oriented | Column-oriented |
| Write pattern | Random updates | Append-only |
| Query optimization | General purpose | Time-series focused |
| Partitioning | Manual | Automatic by time |
| Time operations | Limited | Native support |
| Ingestion rate | Thousands/sec | Millions/sec |
Use Cases
High-Frequency Trading
IoT Sensor Data
Application Monitoring
Next Steps
- Learn about Storage Model for internal architecture details
- Explore SQL Extensions for time-series query capabilities
- Understand WAL Architecture for concurrent write handling