SYSTEM Cited by 1 source
Basin SQL¶
Basin SQL is Cloudflare's serverless, distributed SQL engine for querying Apache Iceberg tables stored in Basin Catalog — the query layer of Basin. It launched at Birthday Week 2025 as R2 SQL and reached GA / was renamed on 2026-10-01. Documented at developers.cloudflare.com/basin-sql. (Source: sources/2026-10-01-cloudflare-introducing-cloudflare-basin-an-open-serverless-data-platform)
What it is¶
"Designed for reading large datasets" and automatically scaling across Cloudflare's global network: "There are no clusters or resources to provision, just a readily available API for you and your agents to immediately start querying your data" (concepts/serverless-compute). Because it queries Iceberg tables directly on Cloudflare — storage and compute separated — it is the on-platform realization of concepts/compute-storage-separation for OLAP workloads.
Distributed execution¶
Basin SQL "uses [Basin Catalog's] statistics to split queries into smaller tasks and distribute them across Workers, keeping queries fast and consistent as datasets scale." This is a scatter-gather execution model running on the Workers substrate, planned from the compaction + statistics that Basin Catalog generates during maintenance.
From filter-engine to full analytical SQL¶
At beta launch Basin SQL "was great at filtering and exploring large event and time-series tables." Over the year it grew into a full analytical engine supporting "hundreds of functions", including:
- Standard + approximate aggregations (
approx_distinct),GROUP BY,HAVING, and schema-discovery commands. - >190 scalar and aggregate functions across strings, timestamps, regex, cryptography, statistics, arrays, maps, and structs.
CASEexpressions, common table expressions (CTEs), casting, arithmetic, andEXPLAIN.- Joins — inner, outer, semi, anti; subqueries; self-joins; multi-table queries.
DISTINCT,UNION,INTERSECT,EXCEPT.- Window functions,
QUALIFY, grouping sets, rollups, cubes. - A suite of JSON functions.
Worked example from the post — join application events to account data, aggregate activity by customer, rank with a window function, filter the ranking in one query:
WITH account_activity AS (
SELECT a.plan, e.account_id,
count(*) AS events,
approx_distinct(e.user_id) AS active_users
FROM analytics.events e
JOIN analytics.accounts a ON e.account_id = a.account_id
WHERE e.event_time >= '2026-09-01T00:00:00Z'
GROUP BY a.plan, e.account_id
)
SELECT *, rank() OVER (PARTITION BY plan ORDER BY events DESC) AS activity_rank
FROM account_activity
QUALIFY rank() OVER (PARTITION BY plan ORDER BY events DESC) <= 10;
Surfaces¶
Run Basin SQL from Wrangler, the API, or the built-in dashboard editor — the editor provides syntax highlighting + autocomplete, a browser for namespaces/tables, query statistics and plans, and exportable results. "It makes the path from a new table to a useful answer a matter of seconds."
Roadmap (stated)¶
- Advanced statistics + adaptive scheduling to improve query performance and efficiency.
- Full DDL support directly from Basin SQL (today writes go through Pipelines or an external Iceberg engine — Basin SQL is read-oriented).
- Iceberg V3 support including VARIANT + geospatial types.
Caveats¶
- GA announcement — no query-latency or throughput benchmarks.
- Read-oriented today: "designed for reading large datasets"; DDL is explicitly still future work.
Seen in¶
- sources/2026-10-01-cloudflare-introducing-cloudflare-basin-an-open-serverless-data-platform — canonical wiki source. GA + rename from R2 SQL; Workers-distributed scatter-gather execution; 190+ functions, joins, window functions.
Related¶
- systems/basin — the umbrella platform.
- systems/basin-catalog — supplies the planning statistics Basin SQL consumes.
- systems/basin-pipelines — the write path (Basin SQL is read-oriented).
- systems/apache-iceberg — the table format queried.
- systems/cloudflare-workers — the distributed execution substrate.
- systems/cloudflare-r2 — where the Parquet data lives.
- concepts/scatter-gather-query — the distributed execution model.
- concepts/serverless-compute — the no-provisioning model.
- concepts/compute-storage-separation — the structural property.
- concepts/oltp-vs-olap — the analytical workload class.
- companies/cloudflare — operator.