“Semantics is the brain of AI.” See what it means for you
Unwind DataUnwind Data
Semantic Layer

dbt Semantic Layer vs Cube: Which Fits Your Data Stack?

dbt Semantic Layer and Cube are not interchangeable. One defines metrics. The other defines and serves them. This is the architectural difference that determines which one belongs in your stack.

Talk to an expert

The dbt semantic layer vs Cube debate is the most common architecture question I hear from data teams right now. Both are open source. Both sit between your warehouse and your consumers. Both let you define metrics once and use them everywhere.

So which one do you choose?

Most comparisons answer this with a feature table. That is not how the decision actually works. The dbt Semantic Layer, powered by MetricFlow, and Cube are not competing for the same job. They solve the problem from different architectural positions, and picking the wrong one means rebuilding in 18 months.

I have implemented both. This guide covers the architectural distinction most comparisons skip, what changed materially in 2025 and 2026, how each tool handles the AI agent use case, and a practical framework for making the call in your stack.

The architectural gap nobody explains clearly

The dbt Semantic Layer is a definition layer. It lets you describe metrics, dimensions, and entities in YAML files that live inside your dbt project, version-controlled alongside your transformations. When someone queries a metric, the request goes through dbt Cloud's Semantic Layer API, which translates it into SQL and fires it against your warehouse. That is the complete picture.

Cube is a definition-and-serving layer. It also describes metrics in YAML (or JavaScript). But Cube runs as a standalone server, sitting between your consumers and your warehouse. It pre-aggregates frequently queried combinations into its own columnar store (CubeStore), caches results, exposes REST, GraphQL, SQL, MDX, and DAX APIs, and handles multi-tenancy and row-level security natively.

The practical difference: the dbt Semantic Layer defines your metrics and lets the warehouse do all the serving. Cube defines your metrics and takes over the serving layer itself.

This one architectural distinction drives almost every trade-off that follows. A team that misses it tends to choose based on brand familiarity or community size, which is how you end up rebuilding in a year.

What changed materially in 2025 and 2026

The comparison from even 18 months ago is outdated. Several meaningful developments have shifted the landscape.

MetricFlow went open source. In October 2025, dbt Labs open-sourced MetricFlow under an Apache 2.0 license. This matters for the dbt Core community: you can now run MetricFlow locally against your dbt Core project without a dbt Cloud subscription. The catch is that the Semantic Layer API, the managed gateway that connects downstream BI tools and applications to your metrics, still requires dbt Cloud. Local MetricFlow is useful for development, testing, and ad-hoc queries. Production API access is still gated.

dbt launched a native MCP server. In early 2026, dbt Labs released an official Model Context Protocol server for the dbt platform. It exposes your dbt project to AI clients, including the Semantic Layer, Discovery API, and dbt CLI, through the same protocol that tools like Claude use to interact with data systems. There are two modes: a local MCP server that runs on your machine and supports full CLI access, and a remote MCP server that connects to the dbt platform via HTTP with no local installation required. For teams building AI agent workflows on top of a dbt-managed semantic layer, this is the most important infrastructure development of the year.

Cube released a significantly faster query engine. Cube's 2025 release introduced a WASM-powered query engine and roll-up anytime materializations. The WASM engine pushes P95 query latency to under one second on Snowflake for pre-aggregated queries. Roll-up anytime materializations mean Cube no longer needs to pre-define every possible query combination in advance: it materializes on demand and reuses results intelligently. For embedded analytics use cases where query volume was historically the limiting factor, this is a meaningful engineering improvement.

The dbt and Fivetran merger changed the stack context. In 2026, dbt Labs and Fivetran signed a definitive merger agreement. The combined entity controls transformation (dbt), ingestion (Fivetran), and the semantic layer (MetricFlow) in one platform. For organizations evaluating a long-term data stack, this consolidation is relevant context. The dbt Semantic Layer is becoming part of a broader platform play, not just a standalone tool. Whether that is a feature or a concern depends on how much you value vendor independence at the platform layer.

What the dbt Semantic Layer actually does well

If your data team already runs dbt, the Semantic Layer is the lowest-friction path to governed metrics. Metric definitions live in the same Git repository as your transformations. The same CI/CD pipeline, the same pull request workflow, the same dbt build command. You are not introducing a new tool, a new server, or a new deployment surface.

The governance model is strong. When a metric definition changes, it goes through version control. You can see exactly what changed, who approved it, and what downstream queries will be affected before anything goes to production. For data teams that have fought hard for engineering discipline in their analytics workflows, this feels like the natural extension.

The ecosystem is growing. The dbt Semantic Layer API integrates directly with Looker, Hex, Mode, Tableau (via connector), and others. For most internal BI use cases, that coverage is sufficient. The data pipeline that feeds these definitions is increasingly end-to-end: Fivetran brings in the raw data, dbt transforms it, MetricFlow defines the metrics, and downstream tools consume through the API. That is a coherent single-vendor data infrastructure story for mid-market teams that value simplicity over flexibility.

There are two constraints worth stating plainly. First, the production Semantic Layer API requires dbt Cloud. Teams running dbt Core cannot access the downstream API gateway without a Cloud subscription. This is not a minor footnote: it means the feature has a meaningful cost floor that does not exist with Cube. Second, there is no caching or pre-aggregation. Every query hits your warehouse directly. For dashboards with dozens of users, this is fine. For high-concurrency use cases or customer-facing analytics products, it becomes a cost and latency problem quickly.

For a deeper look at how MetricFlow works in practice, see our guide to the dbt Semantic Layer and MetricFlow.

What Cube actually does well

Cube's strength is in what happens after metric definition. The serving layer is the differentiator.

Pre-aggregations are the clearest example. Cube pre-computes frequently queried metric combinations and stores them in CubeStore, its columnar storage engine. A query that normally hits your Snowflake warehouse and costs compute cycles instead returns from cache in milliseconds. The 2025 WASM engine update pushed this further: P95 latency under one second on Snowflake is achievable for pre-aggregated queries today. For embedded analytics products, customer-facing dashboards, or any situation where query volume and latency matter, this capability changes the economics entirely.

The API surface is broader. Cube exposes REST, GraphQL, SQL, MDX, and DAX APIs simultaneously. Any consumer, from a BI tool to a custom application to an AI agent, can query your governed metrics through the protocol it prefers. The dbt Semantic Layer offers JDBC and GraphQL. Cube offers those plus everything else, which matters when your consumers are diverse and you do not control their integration patterns.

Multi-tenancy is a first-class concern in Cube. You can isolate metric access per customer, per tenant, or per user group through Cube's security contexts. This is the architecture that powers embedded analytics products: one Cube deployment serves multiple end-customers with isolated data access. The dbt Semantic Layer does not have an equivalent mechanism.

Open-source flexibility is real. Cube's full stack, including the serving layer, APIs, and CubeStore, runs entirely on your own infrastructure without a paid subscription. This is meaningfully different from the dbt Semantic Layer, where the managed API gateway is a Cloud-only feature. Organizations with strict data residency requirements, fully self-hosted infrastructure, or budget constraints that preclude managed services have a path with Cube that they do not have with dbt's Semantic Layer in full production configuration.

The trade-off is operational. Cube is a running server. You deploy it, maintain it, monitor it, and scale it. That is infrastructure overhead that the dbt Semantic Layer eliminates by routing through a managed API. For small teams or organizations without platform engineering resources, that overhead is real. An under-resourced team that deploys Cube without a plan for keeping it running will find that the operational burden offsets the technical advantages.

The AI agent question

This is where the comparison gets most interesting for 2026 deployments, and where both tools have moved fastest.

AI agents need governed data. An agent querying your warehouse without a semantic layer picks whichever definition of revenue it finds first. It does not know whether that definition accounts for refunds, FX conversions, or the Q4 accrual adjustment your finance team made three years ago. The semantic layer is the component that prevents this. Both tools provide that foundation. The question is which one provides better agent connectivity today.

The dbt MCP server is the most significant development for dbt Semantic Layer and AI integration. The server exposes your dbt project to any MCP-compatible AI client, including the Semantic Layer, Discovery API, and project metadata. An AI agent can query governed metrics, retrieve model lineage, and understand the data model structure through a standardized protocol. The local MCP server also supports text-to-SQL generation using your project context, which gives AI systems a much higher baseline accuracy than generic SQL generation. For data teams already invested in dbt, this is a significant step toward AI-ready data infrastructure without adding a new system.

Cube's AI integration is broader from an API surface perspective. It provides a dedicated AI API endpoint, a semantic model agent that serves the full data model in a format LLMs can reason over, and MCP integration for agent connectivity. Cube's broader set of API protocols (REST, GraphQL, SQL, MDX, DAX) means AI systems can query governed metrics through whatever interface they were built for. In 2024 and early 2025, this gave Cube a measurable lead for AI use cases. That gap has narrowed considerably with the dbt MCP server launch.

In practice today: if your AI agent workflow is built primarily in the dbt Cloud ecosystem, the dbt MCP server gives you governed metric access with minimal additional infrastructure. If your AI agent stack is multi-tool, diverse in protocol requirements, or serving external customers, Cube's broader API surface and open-source flexibility still give it an edge.

For more on MCP and semantic layer governance, see our guide on why MCP without a semantic layer will fail.

Developer experience in practice

The technical comparison between these tools often obscures the day-to-day experience of working with them. Both use YAML-based metric definitions, but the authoring workflow is different in ways that matter.

In the dbt Semantic Layer, metric definitions live alongside your dbt models in the same project. You write a semantic model YAML file that references a specific dbt model, then define entities, dimensions, and measures against it. The tooling is familiar: the dbt VS Code extension provides validation, the dbt CLI runs MetricFlow locally for development queries, and CI/CD works exactly like your existing dbt workflow. For an analytics engineering team that already thinks in dbt, the cognitive overhead of adding semantic definitions is low.

In Cube, you define cubes (equivalent to dbt models) and views (join relationships) in separate YAML or JavaScript files that live in the Cube project, which is typically a separate repository or directory from your dbt project. If you use dbt for transformation and Cube for the semantic layer, you are managing two separate codebases that both reference the same warehouse tables. This is a real operational split. Teams that run this combination successfully typically treat Cube definitions as a downstream artifact that references dbt-transformed tables, not as a replacement for the transformation layer.

Testing workflows differ as well. The dbt Semantic Layer inherits dbt's testing infrastructure: you can run dbt tests against the same models that power your metrics, in the same CI run. Cube has its own sandbox environment for testing queries against dev, test, and production warehouses, with dedicated dev and production credentials for connected BI tools. Both approaches work; neither is obviously superior. The dbt approach favors teams that want unified test coverage across transformation and metric logic. The Cube approach favors teams that want an isolated semantic layer environment that does not depend on the transformation tool's test runner.

Migration patterns: what happens when you switch

I have been involved in migrations in both directions. Here is what actually happens in practice.

From Cube to dbt Semantic Layer. This migration typically comes from teams that started with Cube as a standalone tool and then adopted dbt more deeply. The main conversion work is rewriting Cube definitions (cubes and views) into MetricFlow semantic models (entities, dimensions, measures). The semantic model for a single cube typically takes one to three hours to convert correctly, depending on complexity. The harder work is often removing the operational Cube server from your architecture: any downstream BI tools, applications, or AI agents that hit the Cube SQL or REST API need to be migrated to the dbt Semantic Layer API. In our experience, the tooling migration takes longer than the definition migration. Plan for it.

From dbt Semantic Layer to Cube. This migration typically comes from teams that hit the caching or multi-tenancy wall. They chose the dbt Semantic Layer for internal dashboards and then discovered they were building a product for external customers. The definition conversion is similar in effort. The main addition is setting up the Cube server, CubeStore, and the pre-aggregation definitions, which requires architectural planning that was not needed in the dbt Semantic Layer setup. Teams that make this migration typically say they should have made it earlier: the operational overhead of Cube is higher upfront, but the performance and multi-tenancy capabilities unlock use cases that were blocked before.

The OSI specification, discussed below, is making both migration paths progressively less expensive. As more tooling implements OSI-compatible export and import, definition conversion becomes closer to a command-line operation rather than a manual rewrite.

OSI: why this choice is less permanent than it looks

The Open Semantic Interchange specification, released in January 2026, is the most important development in this comparison that most comparisons are not yet incorporating.

OSI is a vendor-neutral, YAML-based standard for representing semantic metadata. Snowflake, dbt Labs, Cube, AtScale, Databricks, Salesforce, Tableau, BlackRock, and over 40 other partners have committed to supporting it. The practical implication: metric definitions you write today in dbt's YAML format could theoretically be consumed by Cube tomorrow, or by Snowflake's Semantic Views, without rewriting anything. OSI uses MetricFlow as its declarative specification, which means the dbt Semantic Layer's definition format is effectively becoming the open standard that the broader ecosystem converges on.

This does not mean the tools are interchangeable. The serving architecture, the caching, the multi-tenancy, the API surface, the operational model: none of that transfers through OSI. But it does mean the business logic you encode in either tool is increasingly portable. The lock-in risk, which has historically made this decision feel permanent, is shrinking. By the end of 2026, OSI compliance will be a standard evaluation criterion for any semantic layer tool in an enterprise data architecture discussion.

We covered the full OSI ecosystem in detail in our guide to Open Semantic Interchange participants.

The hidden constraint: dbt Cloud pricing and the open-source gap

One thing every comparison glosses over: the dbt Semantic Layer API is a dbt Cloud feature. Teams running dbt Core, the open-source version, cannot access the downstream API gateway without a paid subscription.

This matters because many data teams use dbt Core in production, either for cost reasons or because they run fully self-hosted infrastructure. If that describes your organization, the dbt Semantic Layer's production API is not actually available to you unless you move to dbt Cloud. MetricFlow's open-sourcing in October 2025 changed local development access: you can now run MetricFlow queries locally without dbt Cloud. But the API that connects downstream BI tools and applications still requires the managed platform.

Cube's open-source version has no such constraint. You can run the full Cube semantic layer, including the serving layer, CubeStore pre-aggregations, and all API endpoints, entirely on your own infrastructure without a subscription. The Cube Cloud offering adds managed infrastructure and support, but the open-source stack is not crippled without it.

The flip side: if you are already paying for dbt Cloud, the Semantic Layer is included in Team and Enterprise plans. In that context, the incremental cost is zero, which makes it a very easy first step toward governed metrics. Organizations that view the dbt Semantic Layer as a natural extension of an existing dbt Cloud investment are correct: it is. Organizations that view it as an independent open-source tool they can run anywhere are not correct about the API gateway.

The decision that actually matters: what is consuming your metrics

The most useful way to choose between these tools is not to compare features. It is to look at who and what will be querying your semantic layer.

Use caseBetter fitWhy
Internal BI dashboards on a dbt-first teamdbt Semantic LayerZero new infrastructure. Metrics live with transformations. Native workflow.
Embedded analytics for external customersCubeMulti-tenancy, caching, and per-customer access control are built-in.
High-concurrency dashboards or customer-facing productsCubePre-aggregations eliminate warehouse costs at scale. dbt SL has no caching.
dbt Core users (not dbt Cloud)Cubedbt SL API requires dbt Cloud. Cube is fully open source and self-hostable.
Teams that want metrics-as-code in Git with CI/CDdbt Semantic LayerYAML definitions colocated with dbt models in version control.
Custom applications querying governed metrics via REST or GraphQLCubeBroader API surface; no dbt Cloud dependency for application queries.
AI agents querying business metrics via MCPdbt Semantic Layer (dbt-native teams)dbt MCP server exposes Semantic Layer directly to MCP clients with no additional infra.
Multi-protocol AI or agent systems serving diverse consumersCubeBroader API surface covers REST, GraphQL, SQL, MDX, DAX simultaneously.
Snowflake-native organizationsSnowflake Semantic ViewsNo external tooling. Warehouse-native. Zero operational overhead.

When neither is the right answer

There is a third scenario that neither tool handles optimally: organizations that are Snowflake-native and want their semantic layer to be a first-class warehouse object rather than external middleware.

Snowflake's Semantic Views reached general availability in late 2025 as part of Snowflake Intelligence. Semantic Views are defined directly as Snowflake objects in the catalog. No external server. No middleware latency. No separate deployment. For organizations that have committed to Snowflake as their primary data platform, this architecture eliminates the operational overhead of both dbt SL (dbt Cloud dependency) and Cube (server management) while delivering governed metric definitions that sit alongside tables and views in the warehouse itself.

The trade-off is portability. Snowflake Semantic Views are Snowflake-native. They do not travel to other warehouses. If your data architecture is deliberately multi-cloud or if you want your semantic layer to remain independent of any single warehouse vendor, this is not the right path. But for Snowflake-first organizations, it is worth evaluating seriously before defaulting to either external option. The Semantic View Autopilot feature, launched in early 2026, further reduces the manual work of bootstrapping definitions. See our detailed guide on Snowflake Semantic View Autopilot for the full implementation picture.

The practical recommendation

Based on direct implementation experience across all three approaches, here is how I frame the decision for clients.

Choose the dbt Semantic Layer if your team runs dbt Cloud, your primary consumers are internal BI tools or dbt-native AI agents via MCP, you value keeping metric definitions in the same Git workflow as your transformations, and you do not need pre-aggregation or multi-tenancy. The governance model is excellent and the operational overhead is minimal. The dbt/Fivetran merger also signals that this stack will continue to be invested in and integrated more deeply.

Choose Cube if you need embedded analytics, you are building a data product for external customers, query volume or latency is a concern, you run dbt Core and want to avoid dbt Cloud costs, or you need the broadest possible API surface for diverse consumers including AI agents and custom applications. The self-hosted path is genuine and the performance characteristics at scale are better than anything the dbt Semantic Layer offers today.

The mistake I see most often is choosing based on feature lists rather than consumption patterns. A team that builds a Cube deployment for internal dashboards with 20 users is paying operational overhead they do not need. A team that chooses the dbt Semantic Layer for a customer-facing analytics product will hit the caching and multi-tenancy wall within months. Both mistakes are common. Neither is subtle in hindsight.

Start at the bottom. Ask who and what is consuming your metrics. Then pick the architecture that serves those consumers without adding complexity you will not use.

How this fits the data infrastructure stack

The semantic layer is Layer 2 in the data architecture stack: the component that translates raw data into governed business logic before it reaches any consumer, human or machine. Whether you choose the dbt Semantic Layer, Cube, or Snowflake Semantic Views, the goal is the same. One definition of revenue. One definition of churn. One source of truth for every dashboard, every report, and every AI agent that touches your data.

The choice between tools matters less than whether the layer exists at all. Companies with mature data governance see 24% higher revenue from AI initiatives. That number comes from the semantic layer being in place before the AI agents arrive, not after. Teams that skip Layer 2 and go directly to AI deployment are building on a foundation that will fail them at the worst possible moment: when the agent gives the wrong answer to a question that actually mattered.

For a full breakdown of what a semantic layer actually is and how it fits your stack, see our complete semantic layer guide. For the broader data architecture context, see our guide to data architecture for AI agents.

For every dollar companies spend on AI, six should go to the data architecture underneath it. The dbt SL vs Cube decision is a Layer 2 question. Most organizations are still asking Layer 4 questions first. Start at one, not at four.

Semantic Layer

Deep dives on modern data engineering

Semantic layers, modern stacks, and scalable architecture — in your inbox, not in a backlog.

Trusted by 500+ data leadersFree · Unsubscribe anytime

Unwind Data

Speak with a data expert

We've helped scale-ups and enterprises move faster on exactly this kind of work — without the trial and error. Strategy, architecture, and hands-on delivery.

Schedule a consultation