cube-js/cube

📊 Cube Core is open-source semantic layer for AI, BI and embedded analytics

19,737 stars Rust 11 components 1 connections

Open-source semantic layer for AI, BI and embedded analytics

Queries flow from client APIs through schema compilation and optimization, then to data sources via drivers, with results cached in columnar storage for performance

Under the hood, the system uses 2 feedback loops, 2 data pools, 3 control points to manage its runtime behavior.

Structural Verdict

A 11-component dashboard with 1 connections. 2284 files analyzed. Minimal connections — components operate mostly in isolation.

How Data Flows Through the System

Queries flow from client APIs through schema compilation and optimization, then to data sources via drivers, with results cached in columnar storage for performance

  1. API Request — Client sends query via REST, GraphQL, or SQL to api-gateway
  2. Schema Resolution — schema-compiler resolves semantic definitions into logical query plan
  3. Query Planning — cubesqlplanner optimizes logical plan and checks for cached results
  4. Driver Execution — Database-specific driver executes SQL against data source if cache miss
  5. Result Caching — cubestore stores results in columnar format for future queries
  6. Response Formatting — Results transformed to client-requested format and returned via API

System Behavior

How the system actually operates at runtime — where data accumulates, what loops, what waits, and what controls what.

Data Pools

cubestore (database)
Columnar cache storing pre-aggregated query results and materialized views
Subscription Store (in-memory)
WebSocket subscription registry tracking active real-time query subscriptions

Feedback Loops

Delays & Async Processing

Control Points

Package Structure

This monorepo contains 10 packages:

cubesql (library)
SQL query engine and planner written in Rust for processing semantic queries
cubestore (library)
High-performance columnar storage engine and cache layer built in Rust
server-core (library)
Core TypeScript server orchestrating query processing and schema compilation
api-gateway (library)
HTTP and WebSocket gateway providing REST, GraphQL, and SQL APIs
schema-compiler (library)
Compiles semantic schema definitions into executable queries
query-orchestrator (library)
Manages query execution, caching, and pre-aggregation strategies
database-drivers (library)
20+ database driver packages for BigQuery, Snowflake, Postgres, etc.
client-sdks (library)
Frontend SDKs for React, Vue, Angular and vanilla JavaScript
cubejs-cli (tooling)
Command-line interface for creating and managing Cube projects
playground (app)
Web-based development environment for building and testing queries

Technology Stack

TypeScript (framework)
Primary language for server logic and orchestration
Rust (framework)
High-performance SQL engine and columnar storage
Lerna (build)
Monorepo management and package publishing
Jest (testing)
JavaScript testing framework
Neon (library)
Rust-Node.js native bindings
FlatBuffers (library)
Cross-language data serialization

Key Components

Sub-Modules

Rust Engine Core (independence: medium)
High-performance SQL processing and columnar storage engine
TypeScript Server Stack (independence: medium)
API orchestration, schema compilation, and query coordination
Database Driver Ecosystem (independence: high)
Unified interface to 20+ different data sources and databases
Client SDK Suite (independence: high)
Frontend libraries for React, Vue, Angular, and vanilla JavaScript
Development Tooling (independence: medium)
CLI, playground, testing frameworks, and project templates

Configuration

codecov.yml (yaml)

lerna.json (json)

Explore the interactive analysis

See the full architecture map, data flow, and code patterns visualization.

Analyze on CodeSea

Related Dashboard Repositories

Frequently Asked Questions

What is cube used for?

Open-source semantic layer for AI, BI and embedded analytics cube-js/cube is a 11-component dashboard written in Rust. Minimal connections — components operate mostly in isolation. The codebase contains 2284 files.

How is cube architected?

cube is organized into 5 architecture layers: Rust Engine Layer, TypeScript Orchestration Layer, Driver Abstraction Layer, API Gateway Layer, and 1 more. Minimal connections — components operate mostly in isolation. This layered structure keeps concerns separated and modules independent.

How does data flow through cube?

Data moves through 6 stages: API Request → Schema Resolution → Query Planning → Driver Execution → Result Caching → .... Queries flow from client APIs through schema compilation and optimization, then to data sources via drivers, with results cached in columnar storage for performance This pipeline design reflects a complex multi-stage processing system.

What technologies does cube use?

The core stack includes TypeScript (Primary language for server logic and orchestration), Rust (High-performance SQL engine and columnar storage), Lerna (Monorepo management and package publishing), Jest (JavaScript testing framework), Neon (Rust-Node.js native bindings), FlatBuffers (Cross-language data serialization). A focused set of dependencies that keeps the build manageable.

What system dynamics does cube have?

cube exhibits 2 data pools (cubestore, Subscription Store), 2 feedback loops, 3 control points, 3 delays. The feedback loops handle cache-invalidation and polling. These runtime behaviors shape how the system responds to load, failures, and configuration changes.

What design patterns does cube use?

5 design patterns detected: Driver Pattern, Rust-JavaScript Bridge, Multi-Protocol API Gateway, Semantic Schema Compilation, Caching and Pre-aggregation.

Analyzed on March 31, 2026 by CodeSea. Written by .