explaingit

cube-js/cube

Analysis updated 2026-06-21

19,966RustAudience · dataComplexity · 4/5LicenseSetup · moderate

TLDR

An open source middleware layer that sits between your databases and BI tools, giving every app a single shared definition of business metrics like revenue or active users.

Mindmap

mindmap
  root((cube))
    What it does
      Semantic layer
      Metric definitions
      Unified data API
    Tech Stack
      Rust and Node.js
      Docker
      SQL GraphQL REST
    Integrations
      Snowflake and BigQuery
      Postgres and Athena
      BI tools and AI agents
    Use Cases
      Embedded analytics
      Single source of truth
      Sub-second queries
      AI data access
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Define business metrics once and expose them to multiple BI tools without duplicating SQL queries across each tool.

USE CASE 2

Build embedded analytics dashboards inside your SaaS app with sub-second query performance via Cube's caching engine.

USE CASE 3

Give AI agents consistent, well-defined access to your business data through standard SQL or REST APIs.

USE CASE 4

Connect to Snowflake, BigQuery, or Postgres and serve a unified data API to your frontend in under an hour.

What is it built with?

RustNode.jsDockerSQLGraphQLREST

How does it compare?

cube-js/cubexi-editor/xi-editorbee-san/rustscan
Stars19,96619,82119,770
LanguageRustRustRust
Setup difficultymoderatehardeasy
Complexity4/55/53/5
Audiencedatadeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires a running database connection, Docker quickstart is the fastest path and a browser wizard guides initial configuration.

Use freely for any purpose including commercial, keep the copyright and license notices. Apache 2.0.

In plain English

Cube Core is an open source semantic layer, a middle tier that sits between your databases and the tools or applications that query them. A semantic layer's job is to define business metrics, dimensions, and logic in one place (for example, what exactly "monthly active users" or "revenue" means for your organization) and then expose those definitions through standard APIs so that any BI tool, embedded analytics feature, or AI agent can use them consistently without each tool needing its own hardcoded SQL queries. The problem Cube Core solves is fragmentation: most business intelligence tools have their own proprietary semantic layer baked in, so metric definitions get duplicated and drift apart across tools. Cube Core decouples this layer and makes it reusable. It connects to SQL databases and cloud data warehouses including Snowflake, Databricks, BigQuery, Postgres, and query engines like Athena. Once connected, it exposes your data through REST, GraphQL, and SQL APIs with a built-in caching engine that delivers sub-second query responses even under high load. The quickest way to start is with Docker, a single command launches Cube Core locally, and a browser-based setup wizard guides configuration. You would use Cube Core when building embedded analytics into a product (dashboards inside your SaaS app), when you want a single source of truth for metrics shared across multiple BI tools, or when you want AI agents to have well-defined access to your business data. The backend is written in Rust and Node.js, and is licensed under Apache 2.0.

Copy-paste prompts

Prompt 1
Help me connect Cube Core to a PostgreSQL database and write a schema file that exposes a monthly revenue metric through the REST API.
Prompt 2
I want to build an embedded analytics dashboard in my React app using Cube as the semantic layer. Show me how to query a metric and render it as a bar chart with Recharts.
Prompt 3
Generate a Cube schema file that defines monthly active users, new signups, and churn rate from a PostgreSQL users table with created_at and deleted_at columns.
Prompt 4
Configure Cube pre-aggregations to cache my five most-queried metrics so the dashboard responds in under 100ms even on a large dataset.

Frequently asked questions

What is cube?

An open source middleware layer that sits between your databases and BI tools, giving every app a single shared definition of business metrics like revenue or active users.

What language is cube written in?

Mainly Rust. The stack also includes Rust, Node.js, Docker.

What license does cube use?

Use freely for any purpose including commercial, keep the copyright and license notices. Apache 2.0.

How hard is cube to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is cube for?

Mainly data.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub cube-js on gitmyhub

Verify against the repo before relying on details.