ADX vs. ClickHouse for Database Telemetry: Cost, Schemas, and Tradeoffs
We wrote first-class Rust storage adapters for both Azure Data Explorer and ClickHouse against the exact same telemetry contract. Notes on 64-bit counter quirks, schema design, operational overhead, and real monthly bills from 5 to 500 databases.
Most comparisons of Azure Data Explorer (ADX / Kusto) and ClickHouse are written by vendors selling one of the two.
When we built the warehouse layer for Culprit SQL (covered in Microsoft Database Hub vs. Culprit + ADX), we refused to pick one cloud. We wrote two first-class Rust adapters - culprit-store-adx and culprit-store-clickhouse - against the exact same 18-table *V1 telemetry and Gold diagnosis contract (CulpritIncidentsV1, CulpritFindingsV1, CulpritChangesV1).
Building both adapters side by side exposed every practical quirk in how Kusto and ClickHouse handle 64-bit counters, nullable fields, deduplication, and monthly cloud bills.
Why database telemetry is nastier than HTTP access logs
Database observability has three requirements that trip up naive time-series schemas:
- Exact unsigned 64-bit counters and nanosecond clocks. SQL Server LSNs, PostgreSQL XIDs, and cumulative wait counters exceed 53-bit JavaScript floats (
9,007,199,254,740,993must round-trip without rounding), and short capture windows need nanosecond timestamp ordering. - Strict distinction between
NULL(unmeasured) and0(measured zero). IfVIEW DATABASE PERFORMANCE STATEis missing, storing0deadlocks or0memory-grant waits lies to every downstream check. - Large immutable artifacts. Execution plans (
.sqlplan,EXPLAIN JSON) and.xeldeadlock captures belong in object storage (Azure Blob or S3) keyed by SHA-256 digest, not stuffed inline into analytical columns that ruin columnstore compression.
Both ADX and ClickHouse handle high-rate append workloads effortlessly, provided you respect how their storage engines differ.
Physical schema and query tradeoffs we hit in Rust
| Engineering Dimension | Azure Data Explorer (culprit-store-adx) | ClickHouse (culprit-store-clickhouse) |
|---|---|---|
| Query language | KQL (stored functions with typed tabular parameters; great ergonomics for time-window joins and arg_max) | SQL (MergeTree ordered keys, CTEs, and argMax aggregates; familiar to every backend engineer) |
| Nulls & exact 64-bit ints | Native nullable scalars + dynamic JSON bags; 64-bit signed long requires explicit decimal-string encoding for unsigned u64 above i64::MAX | Native UInt64, Int64, DateTime64(9, 'UTC'), and Nullable(T) or LowCardinality(String) without auxiliary presence columns |
| Hot cache vs object storage | Built-in SSD hot cache + automatic Azure Storage tiering managed by the Kusto service | S3-backed MergeTree disks on ClickHouse Cloud, or local NVMe + tiered S3 on self-hosted StatefulSets |
| Auth & network model | First-class Entra Workload Identity (az / federated OIDC tokens) + Azure Private Link | Mutual TLS, SCRAM-SHA-256 credentials, or AWS IAM roles alongside S3 IRSA |
| Operational overhead | Near zero (managed cluster + auto-stop on Dev/Test tiers) | Near zero on ClickHouse Cloud; moderate if self-hosting Keeper / replication on Kubernetes |
Monthly cost across 10, 50, and 300 databases
Assuming standard 5-minute baseline schedules (Activity, WaitCounters, Operational, Settings, DeadlockHistory), episode-triggered .sqlplan recovery in Blob/S3, and 90 days of retention:
Where ClickHouse wins on price
- 5 to 50 databases on AWS or Kubernetes: A single
m7g.xlarge/ Hetzner / AKS node running ClickHouse with S3 object tiering costs$35 to $80/monthtotal, and ClickHouse Cloud’s serverless/scale-to-zero dev tiers avoid paying idle hourly minimums. - AWS RDS / Aurora fleets: Keeping ClickHouse and S3 in the same AWS region avoids cross-cloud egress fees that you would pay shipping RDS plans into Azure.
Where ADX wins on simplicity
- Azure-heavy shops (50 to 500+ databases): One Entra Workload Identity covers Azure SQL, PostgreSQL Flexible Server, Azure Blob, and ADX ingestion (walkthrough here). Kusto’s caching policy (
alter table ... policy caching hot = 14d) keeps 90-day queries fast without tuning disk policies. - Shared Kusto estate: If your platform team already ships AKS container logs and Envoy traces into ADX, adding
CulpritIncidentsV1lets responders correlate an API spike with a SQL head blocker in one KQL tab.
Switching backends is one flag
Because culprit-archive-web, culprit-notify, and the warehouse MCP server talk to the segregated WarehouseFleetReader and WarehouseIncidentReader traits in culprit-evidence, switching between ADX and ClickHouse changes zero UI views, zero alert rules, and zero MCP prompts:
# Generate schema for ClickHouse instead of ADX:
culprit collect schema --store clickhouse --database culprit > clickhouse-schema.sql
# Render sharded collector configs targeting ClickHouse + S3:
culprit collect sync-inventory \
--cloud aws --region us-east-1 \
--shards 2 \
--target-kind clickhouse \
--clickhouse-endpoint https://ch-internal.corp.example:8443 \
--s3-bucket culprit-evidence-prod \
--output-dir ./deploy/aws-fleet
Pick the store that sits closest to your databases and your existing identity provider; the diagnostic engine stays identical.
Database Hub in Microsoft Fabric is now GA as Microsoft's replacement for Azure SQL Database Watcher. I put its Fabric Capacity Unit math, Power BI Pro viewer cliff, and portal charts next to running Culprit on your own ADX or ClickHouse cluster.