Article illustration 1

Database performance is a cornerstone of modern data-driven applications, especially in fields requiring real-time analytics like finance and IoT. A recent benchmark using the TSBS DevOps workload revealed stark disparities among leading time-series databases, with KDB-X emerging as the undisputed leader. Conducted under identical hardware conditions—a 256-core AMD EPYC server with 2.2TB RAM—the tests exposed how architectural choices translate to real-world efficiency.

The TSBS Benchmark: A Community-Driven Standard

Time Series Benchmark Suite (TSBS), initially developed by InfluxDB and later refined by TimescaleDB, has become the de facto tool for evaluating time-series databases. Designed for vendor-agnostic comparisons, it simulates scenarios like DevOps monitoring through ingestion and query tests. For this study, KX forked the TimescaleDB repository, incorporating QuestDB's fixes to ensure fairness. The focus was solely on query performance across three datasets:
- 3 days, medium rate: 103M rows
- 1 year, low rate: 2.5B rows
- 7 days, high rate: 484M rows

Each database executed identical queries—including aggregations, filters, and group-by operations—against these datasets. Crucially, KDB-X operated under its community edition limitations: just 16GB RAM (8% of available) and four execution threads (1.5% of cores). Competitors used default configurations with full hardware access.

Database Contenders and Their Architectures

Five systems were evaluated:
- KDB-X: Built on kdb+, this columnar database leverages vector processing for rapid time-series analysis. Tested version: 0.1.0.
- QuestDB: SQL-based with time-series extensions like SAMPLE BY. Version: 9.0.0.
- InfluxDB: Specialized for time-stamped data with Flux querying. Version: 2.7.11.
- TimescaleDB: PostgreSQL extension using time-based data partitioning. Version: 2.20.2.
- ClickHouse: Column-oriented OLAP system focused on scalability. Version: 25.6.5.41.

All employ columnar storage, but KDB-X's optimized in-memory processing and q-language integration proved decisive.

Performance Results: A Landslide Victory

KDB-X outperformed competitors in 58 of 64 benchmark scenarios. Key findings:
- Geometric mean slowdown: QuestDB was 3.36x slower; ClickHouse lagged by 161.3x.
- Worst-case disparities: For single-groupby-1-1-1, ClickHouse was 9,792x slower than KDB-X. InfluxDB crashed during groupby-orderby-limit.
- Resource efficiency: KDB-X achieved this with minimal resources, while others consumed full hardware.

The table below details performance ratios for the 1-year dataset (higher ratios indicate greater slowdown vs. KDB-X):

Query QuestDB InfluxDB TimescaleDB ClickHouse
cpu-max-all-1 14.1 23.3 127.2 425.9
cpu-max-all-32-24 5.8 28.5 16.8 32.3
high-cpu-1 8.3 2.4 519.3 443.7
lastpoint 0.8 7069.8 17.4 112.3
GEO MEAN RATIO 4.2 53.1 25.5 161.3

Why This Matters for Developers

These results underscore KDB-X's suitability for latency-sensitive applications like algorithmic trading or real-time monitoring. Its efficiency reduces infrastructure costs and enables complex queries on massive datasets without scaling hardware. Conversely, open-source alternatives showed vulnerabilities—InfluxDB's crash under load highlights stability risks, while ClickHouse's inconsistency suggests optimization gaps.

The full methodology, including dataset generators and query scripts, is publicly available, inviting peer validation. As data volumes explode, benchmarks like this push vendors toward architectural refinements. Future tests will explore multi-client and parallel query scenarios, potentially widening KDB-X's lead. For now, developers prioritizing speed in time-series workloads have a clear frontrunner.

Source: KX Blog