Compare
Cube vs Tinybird vs hypequery: Three Ways to Put an API on ClickHouse
Cube, Tinybird, and hypequery all sit between ClickHouse and your application — but they're a platform, a managed service, and a library. Here's how to actually choose.
Updated
Decision type
Architecture and workflow fit
Audience
TypeScript teams building on ClickHouse
Outcome
Choose a path and move into implementation
Shape
Open-source library inside your app, in TypeScript or Python
Data ownership
Uses the ClickHouse you already run
TypeScript workflow
Queries and response types live in your repo, generated from your schema
What this page is for
Use this page when the real question is how one tool changes the shape of your ClickHouse application code, not just which syntax looks nicer.
What this page is not
It is not a broad ecosystem roundup. It stays narrow on the tradeoff a ClickHouse-heavy TypeScript team is actually deciding.
Recommended next move
If the tradeoff already looks clear, stop reading comparisons and test the fit against one real query in your own schema.
When to pick Cube or Tinybird instead
- Pick Cube when BI tools and your app must share one set of metric definitions, across more than one database.
- Pick Cube when expensive queries hit by many users need managed pre-aggregations.
- Pick Tinybird when you do not run ClickHouse yet and want ingestion plus hosted API endpoints with no ops.
- Pick Tinybird when the team is SQL-first and wants endpoints with token auth and rate limits from the platform.
Published · Updated
If you search "Cube vs Tinybird," you'll mostly find each vendor explaining why the other one is solving a different problem. Which is actually true — they are. But it's not very helpful when what you have is a ClickHouse full of data, an application that needs analytics, and a decision to make.
So here's the version with all three options on the table, including the one where you don't adopt a platform at all.
The one-sentence versions
Cube is a semantic layer platform. It sits between your databases (ClickHouse among many) and your consumers (BI tools, apps, spreadsheets), giving everyone one set of metric definitions, plus caching and pre-aggregations.
Tinybird is a managed analytics backend. Your data moves into their ClickHouse, you write SQL Pipes, and each Pipe becomes a hosted API endpoint with token auth and rate limiting handled for you.
hypequery is an open-source library for TypeScript and Python. It points at the ClickHouse you already run, generates types from your schema, and turns queries written in your repo into typed REST endpoints and React hooks.
A platform, a service, and a library. Most of the decision falls out of which of those shapes fits your team.
What each one is actually for
Cube: many consumers, one set of definitions
Cube earns its complexity when the same metrics need to reach multiple consumers — Tableau over the SQL API, an embedded dashboard over REST, a data app over GraphQL — and you need "revenue" to mean the same thing in all of them. Pre-aggregations are the other headline: for expensive queries hit by many users, Cube's caching layer does real work.
The cost is that Cube is infrastructure. There's an API server and a cache store to run (or a Cube Cloud bill), a modelling layer in YAML/JS to maintain, and a query JSON format your app speaks instead of SQL or your own types.
Tinybird: zero ops, fastest path to a hosted API
Tinybird's whole pitch is speed without infrastructure. Data streams in, SQL Pipes transform it, and endpoints appear with tokens and rate limits already sorted. For a team with no ops capacity that needs a public-facing data API this quarter, it's genuinely hard to beat.
The costs are the ones managed platforms always have: your data lives in their ClickHouse, pricing is a plan sized in vCPUs on top of anything else you run, and the workflow is SQL-first. Tinybird's TypeScript SDK, which it marks experimental, infers types from the resources you define for Tinybird, not from a ClickHouse you already run.
hypequery: your ClickHouse, your repo, your types
hypequery assumes the database part is handled — you're on ClickHouse Cloud or self-hosting — and the missing piece is everything between ClickHouse and your TypeScript code. Types are generated from the live schema (with correct runtime mappings — UInt64 comes back as a string, and your types know it). Queries are code. Endpoints come from @hypequery/serve with validation and OpenAPI docs. Dashboards use typed React hooks on the same contracts.
The cost: you run your own ClickHouse (or pay ClickHouse Cloud to), and auth, rate limiting and caching come from @hypequery/serve and the query builder running in your own app, rather than from a platform.
The table
| Cube | Tinybird | hypequery | |
|---|---|---|---|
| Shape | Semantic layer platform | Managed analytics service | Open-source library |
| Your data lives | In your databases | In Tinybird's ClickHouse | In your ClickHouse |
| Queries defined in | YAML/JS data models | SQL pipes in datafiles or TypeScript, deployed to Tinybird | TypeScript or Python in your repo |
| TypeScript types | Hand-written for Cube responses | Inferred from Tinybird definitions (SDK marked experimental) | Generated from your schema |
| BI tools (Tableau etc.) | Yes — a core strength | Not the focus | No |
| Caching / pre-aggs | Pre-aggregations in Cube Store, a core strength | Materialized views and copy pipes | Optional result cache / ClickHouse MVs |
| Auth & rate limiting | Auth through Cube's security context | Tokens, plus JWTs with rate limits | JWT auth and rateLimit in @hypequery/serve |
| Ops burden | Run Cube (or pay Cube Cloud) | None | Run ClickHouse (or use Cloud) |
| Pricing | Cube Core is open source; Cube Cloud per developer seat, with a Free plan | Free plan, then plans sized in vCPUs | Free, open source |
| MCP server | Yes, in Cube Cloud | Yes | @hypequery/mcp |
| Databases | Many | ClickHouse (theirs) | ClickHouse (yours) |
How to actually decide
Do BI tools need to consume the same metrics as your app? If yes, Cube — it's the only one of the three that treats Tableau and Metabase as first-class consumers.
Do you have zero ops capacity and no ClickHouse yet? Tinybird. Adopting ClickHouse plus an API layer is exactly the work it exists to remove. (Compare honestly against ClickHouse Cloud + hypequery, which keeps ownership at the cost of slightly more assembly.)
Do you already run ClickHouse and build in TypeScript? This is hypequery's home turf. A platform in the middle adds a second place your schema lives, a second pricing meter, and a second deploy pipeline — for capabilities your API stack may already have.
Is data residency non-negotiable? Tinybird is hard to fit: its self-managed regions, which run in your own AWS account, are beta and for development only. Cube and hypequery both leave data where it is.
Is the team SQL-first rather than TypeScript-first? Tinybird's Pipes workflow will feel natural. hypequery's value — compile-time types, code review, refactoring — mostly pays off for teams living in TypeScript.
Can you mix them?
Sometimes sensibly. Cube for the data team's BI consumers plus hypequery for product-facing features is a real pattern — they serve different audiences from the same ClickHouse. Tinybird combines less well, since it wants to be the database too.
Where to go from here
The pairwise pages go deeper: hypequery vs Cube and hypequery vs Tinybird. If you're leaving one of them, the switching guides cover migration specifics: Cube.js alternative, Tinybird alternative.
And if you want to skip straight to evidence: the quick start gets you from your ClickHouse schema to a typed, served endpoint in a few minutes — which is usually enough to know whether the library approach fits.
Decision checkpoint
If the tradeoff is already clear, move into implementation
Most teams do not need another round of comparison content after this point. The better test is whether the workflow holds up on your own schema and your own query complexity.
Related content
Continue into implementation
Get started
Pick TypeScript or Python and define your first dataset.
ClickHouse semantic layer
Datasets, tenant rules, and one definition behind every API and agent.
Python semantic layer
The same datasets, defined and served from Python.
Compare more options
Return to the comparison hub if you want to evaluate the other path next.
FAQ
When should I choose Cube?
Choose Cube when multiple consumers, especially BI tools, need the same metric definitions and pre-aggregations from a central semantic layer.
When should I choose Tinybird?
Choose Tinybird when you want the fastest managed path from data ingestion to hosted analytics APIs and are comfortable with the platform owning that serving layer.
When should I choose hypequery?
Choose hypequery when you already run ClickHouse and want schema-generated datasets and served endpoints inside your own application codebase, in TypeScript or Python.
Next step
Move from evaluation to your first dataset
Define a dataset in TypeScript or Python, query it by name, and decide whether it runs in-process or over HTTP.