dbt Semantic Layer vs Cube.dev vs MetricFlow for ClickHouse (2026)
Three semantic layers, one warehouse. This is the honest comparison of query performance, dialect coverage, developer experience, and total cost when the warehouse under the hood is ClickHouse.
You have picked ClickHouse. The warehouse is fast, the ingestion is settled, and the dashboards work. Now the analytics engineer on your team wants a semantic layer, because half the KPI SQL in production is copy-pasted from a Slack thread from 2024 and nobody is sure the “MRR” chart on the exec dashboard uses the same definition as the one in the churn model.
Three tools show up on every shortlist in 2026: dbt Semantic Layer, Cube.dev, and MetricFlow as a standalone open-source engine. The category is small enough that a real comparison is possible, and large enough that the wrong pick costs you six months.
This post is the honest side-by-side for a ClickHouse stack. Query performance, dialect coverage, developer experience, price, lock-in. No vendor list. If your warehouse is Snowflake or BigQuery the answer is different; ClickHouse changes the calculus.
Why ClickHouse changes the semantic-layer decision
Most semantic layers were designed with Snowflake or BigQuery in the background. Both dialects are ANSI-forward, both have expensive per-query cost that makes caching non-optional, and both have deep native support in every tool that ships. ClickHouse breaks three assumptions those tools were built on.
First, ClickHouse SQL is close to but not identical to ANSI. argMax, arrayJoin, quantileTDigest, Merge engines, and the entire family of -If and -Array combinators do not exist in the other dialects. A semantic layer that compiles to “generic SQL” and hopes the warehouse takes it will leave 60% of the performance on the floor.
Second, ClickHouse is fast enough that the caching layer most semantic-layer vendors sell as a feature is often a liability. A query that returns in 200ms uncached does not need a pre-aggregate. A cache that adds even 50ms of round-trip overhead and requires invalidation logic is negative value.
Third, materialised views and projections are first-class in ClickHouse. Any semantic layer that pretends the warehouse has no opinion about pre-aggregation is competing with a feature the warehouse already ships for free.
Keep those three in mind. They rank the three tools differently than the generic comparisons on vendor blogs.
dbt Semantic Layer
The dbt Semantic Layer is the hosted product dbt Labs shipped in 2023 after they acquired Transform and folded its engine, MetricFlow, into dbt Cloud. You define metrics in YAML inside your dbt project, dbt compiles them against your ref() graph, and dbt Cloud exposes a JDBC + GraphQL query endpoint that any supported BI can call.
ClickHouse dialect support. This is the biggest gap. MetricFlow (the compiler under the dbt Semantic Layer) supports a defined list of adapters, and ClickHouse is not on it. The dbt-clickhouse adapter is community-maintained and covers model materialisation well, but MetricFlow itself compiles down to a small set of ANSI-flavoured dialects. Running the dbt Semantic Layer against a ClickHouse warehouse is possible via workaround (ClickHouse-flavoured SQL functions in the model layer, MetricFlow generating a naive SUM/COUNT/GROUP BY on top), but the fancy stuff that makes ClickHouse fast is not compiled for you. Expect to hand-write the CH-specific expressions inside your dbt models and let MetricFlow do the aggregation.
Query performance shape. dbt Cloud caches results in its query layer, and the underlying dbt models can be incremental or materialized: table. The Semantic Layer itself does not push down aggregations into pre-aggregates the way Cube does; it compiles a fresh SQL statement for each query and relies on the warehouse to be fast. On ClickHouse that trade is fine, because CH is fast, but you lose the “sub-second on billion rows” pitch you would get from a caching layer running against Snowflake.
Developer experience. YAML in your dbt project, alongside your models. If your team already lives in dbt, this is a small addition. The dbt blog is heavy on Semantic Layer content in 2026, and the docs are the best of the three. dbt sl query gives you a local CLI to test metrics before you ship them. If you don’t already have dbt, the whole product is a heavier lift because you inherit dbt’s dependency graph as well.
Cost. MetricFlow the engine is BSL-licensed open source and free to self-host, but the Semantic Layer product (the JDBC endpoint, the query surface, the BI integrations) is a paid dbt Cloud feature. dbt Cloud Team starts around $100 per developer per month, Enterprise is quote-based. If you want the hosted query surface, you pay per seat. If you can live with the CLI-only experience, you get the engine free.
Where it locks you in. Your metric YAML is portable in shape but tied to dbt’s ref() graph and dbt’s model conventions. Migrating out means rewriting every metric against the raw warehouse tables. The bigger lock-in is the query surface: BI tools that speak the dbt Semantic Layer’s JDBC/GraphQL are a shortlist, and moving off means rewiring every BI connection.
Cube.dev
Cube is a headless BI framework. It exposes a semantic layer behind SQL, REST, and GraphQL surfaces, so any front-end (dashboard, notebook, spreadsheet plugin, AI seat) can hit the same layer and get the same answer. Cube’s open-source core is Apache 2.0; Cube Cloud is the paid hosted tier.
ClickHouse dialect support. This is Cube’s strong side. The Cube ClickHouse driver is first-class and current, and Cube compiles idiomatic ClickHouse SQL. countDistinctApprox, HAVING on aggregate expressions, PREWHERE, and time-bucketed toStartOfDay / toStartOfWeek all work in Cube’s compiler without your intervention. Of the three, Cube is the only one that treats ClickHouse as a supported first-tier warehouse instead of a community adapter.
Query performance shape. Cube’s pre-aggregation layer is the differentiator. You declare a pre-aggregate in the cube definition, Cube materialises it in the warehouse (or in Cube Store, its own columnar cache), and every matching query rewrites to hit the pre-aggregate instead of the raw table. On ClickHouse this competes with the warehouse’s own materialised views and projections, and the outcome depends on how much of your query surface hits high-cardinality dimensions. Pre-aggregates win on repeated aggregate queries; raw ClickHouse wins on ad-hoc drilldowns. Cube’s cache invalidation is time-based (“every 1 hour”) or event-based, and the invalidation windows are your responsibility to reason about.
Developer experience. Cube definitions are JavaScript or YAML. The JS is more expressive but ties you to the Cube runtime; the YAML is portable but less powerful. Cube Cloud ships a dev playground, a schema explorer, and a query surface with a UI that most teams find pleasant. The learning curve is steeper than dbt because you are learning both the semantic modelling and Cube’s own concepts (cubes, views, pre-aggs, rollups).
Cost. Cube Core is Apache 2.0 and free to self-host. Cube Cloud starts free for a small workload, then moves to a usage-based tier for anything production-scale. Enterprise is quote-based and includes SSO, audit log, and support. Self-hosting is real: teams run Cube in Docker or Kubernetes without a paid seat and get most of the value. The paid tier buys you Cube Store (the caching layer), pre-agg orchestration, and support.
Where it locks you in. Cube’s schema language is Cube-specific. Metrics defined in Cube do not port to dbt or LookML without rewriting. The query surface (SQL API on port 15432, REST, GraphQL) is a Cube contract; migrating BI tools off Cube means either rewriting queries or standing up another semantic layer that speaks the same surfaces. In practice teams that pick Cube stay on Cube.
MetricFlow (standalone)
MetricFlow started as Transform’s core engine and became dbt Labs’ internal engine when they bought Transform. In parallel, the source is on GitHub under a BSL licence and you can run it standalone against your warehouse. This section is about that standalone use, not the hosted dbt Semantic Layer.
ClickHouse dialect support. Weak. MetricFlow’s dialect registry supports a small set of adapters (Snowflake, BigQuery, Databricks, Redshift, Postgres, DuckDB). ClickHouse is not on the list. A community fork or your own adapter is required, and neither is production-grade in 2026. This is the biggest strike against running standalone MetricFlow on a CH stack.
Query performance shape. MetricFlow compiles a query per request. No caching, no pre-aggregation orchestration, no query-level TTL. If you want caching, you build it in the layer above (a query result cache in Redis, a Grafana caching plugin, whatever you have). This is a reasonable posture for a small team that wants “definitions in one place” and does not want another moving part, but it means every query hits the warehouse and every warehouse cost shows up on your bill.
Developer experience. YAML for the semantic manifests, CLI for the queries. mf query --metrics revenue --group-by metric_time__month is the smoke test. There is no bundled UI. Every downstream tool has to hit MetricFlow’s Python API or shell out to the CLI, and that surface is not as production-grade as Cube’s SQL API or dbt Cloud’s JDBC. Teams that pick standalone MetricFlow are usually running everything through Python or a bespoke internal service that wraps the CLI.
Cost. BSL, free. The BSL restricts commercial hosting of MetricFlow as a competing service, which is dbt Labs protecting the dbt Cloud product; for anyone running it internally the licence is effectively free. There is no paid tier for standalone MetricFlow. The trade is that you own the operational surface entirely.
Where it locks you in. The YAML manifest shape is MetricFlow-specific but conceptually similar to other semantic layers, so migration cost is moderate. The bigger risk is unclear direction: dbt Labs’ priority is the hosted product, and the standalone story gets less love. Standalone MetricFlow in 2026 feels less “actively developed” and more “maintained enough to keep the engine honest.” That is fine if you want stability, less fine if you want a roadmap.
Decision matrix
| Question | dbt Semantic Layer | Cube.dev | MetricFlow (standalone) |
|---|---|---|---|
| Native ClickHouse dialect | Weak (via dbt-clickhouse workaround) | Strong (first-tier adapter) | Weak (no supported adapter) |
| Caching / pre-aggregation | Cloud query cache only | Pre-aggs + Cube Store cache | None (build it yourself) |
| Query surface | JDBC + GraphQL (dbt Cloud) | SQL + REST + GraphQL | Python API + CLI |
| Definition language | YAML in dbt project | YAML or JavaScript | YAML manifest |
| Open source | MetricFlow engine BSL, hosted layer paid | Core Apache 2.0, hosted paid | Fully BSL |
| Free self-host viable | No (hosted only for real BI use) | Yes | Yes |
| Paid entry point | $100 per user per month (Team) | Usage-based Cloud tier | N/A |
| Fits a small team | If already on dbt | Yes, minimal ops | Yes, if Python-first |
| Fits a multi-BI stack | Only via JDBC-speaking BIs | Yes (SQL/REST/GraphQL) | Awkward |
| Fits an AI-Q&A workload | Yes via JDBC | Yes via SQL API | Requires custom wrapper |
| Lock-in shape | dbt graph + JDBC surface | Cube schema + Cube surface | Low (manifest is portable) |
Read the table one way: if you already run dbt for models and have a BI tool that speaks the Semantic Layer, dbt is the low-friction pick despite the weaker ClickHouse dialect coverage. Read it another way: if ClickHouse performance and multi-surface flexibility matter more than staying inside the dbt ecosystem, Cube is the better fit. Read it a third way: if you are a small team with Python everywhere and no appetite for another service to run, standalone MetricFlow is fine and free but you own the whole operational story.
Two shapes to watch out for. First, the ClickHouse dialect gap on MetricFlow (both hosted and standalone) is real; teams underestimate it because dbt’s model layer works fine on CH via dbt-clickhouse, but the Semantic Layer compiler is a separate story. Second, Cube’s pre-aggregation is a feature and a commitment: you take on responsibility for cache invalidation, refresh windows, and pre-agg storage, in exchange for the sub-second query surface Cube is famous for. If your CH warehouse is already fast enough for uncached queries, that trade may not be worth taking.
Closing
Three tools, three genuine trade shapes. Pick on dialect coverage and lock-in first, features second. The features converge; the fit to your warehouse does not.
If you would rather not run a separate semantic layer at all, Goni ships one built into the BI product, native to ClickHouse, and governed by git in a single place. That is a valid fourth option worth knowing about, and it removes the “which tool do we integrate” question entirely.