Cloudflare Basin SQLRenamed
Cloudflare’s serverless, distributed SQL engine for Apache Iceberg tables in Basin Catalog on R2, called R2 SQL until it became generally available on 1 October 2026, billed by the data it scans.
- What it is
- Query engines
- Type
- Commercial product
- Made by
- Cloudflare, Inc.
- License
- Proprietary
- Status
- Renamed. Called R2 SQL until 1 October 2026, when it became generally available as Basin SQL; existing R2 SQL APIs still work but will be deprecated.
- Facts checked
- 12 October 2026
What it is
You send a SQL query to an API endpoint or run wrangler basin sql query <warehouse> "…", and there is no cluster to size or start. The server that takes the query becomes its coordinator. It walks the Iceberg metadata from Basin Catalog top down: the manifest list’s partition ranges rule out whole manifests, then per-file min/max and null counts rule out individual Parquet files, so it knows which row groups and byte ranges to read before touching any data. It then hands batches of row groups, with their exact byte offsets, to query workers on healthy servers across Cloudflare’s network. Each worker runs Apache DataFusion over its row groups with ranged reads from R2 and filters pushed down into the Parquet scan, and returns Apache Arrow results that the coordinator merges.
At its beta launch in September 2025 it handled mainly filter queries. By general availability it supported joins of all kinds, subqueries, CTEs, window functions with QUALIFY, grouping sets, set operations, approximate aggregates and more than 190 functions. It is read-only (no INSERT, DDL or OFFSET) and reads Parquet only. Pricing is a single dimension, compressed data scanned: 10 GB a month included, then $0.0025 per GB ($2.50 per TB), with a 10 MB minimum per query and free metadata commands such as EXPLAIN. R2 reads count as R2 operations, and there are no egress fees.
Why teams pick it
- No clusters or warehouses: compute spreads across Cloudflare’s network per query and costs nothing when idle
- Pruning on Iceberg partition and column statistics means a well-partitioned table with a time filter reads only a small part of the data
- $2.50 per TB scanned with no egress, next to the data it queries in R2
- The same tables stay open to DuckDB, Spark, Snowflake or PyIceberg through Basin Catalog
Watch out for
- Read-only and Parquet-only: tables are created and written by Basin Pipelines or another Iceberg engine
- Memory-heavy queries (three or more large joins,
COUNT(DISTINCT),ARRAY_AGG, big sorts) may time out or be rejected up front with a 400 - No
OFFSET, namedWINDOW,UNNEST,PIVOTorLATERAL - Only queries tables in Basin Catalog, needs an R2 subscription with a payment card, and older R2 SQL names are being deprecated after the October 2026 rename
Alternatives
What all query engines have in common →
Amazon AthenaAWSAWS’s serverless SQL engine for data in S3: no cluster to run, and on-demand queries cost $5 per TB scanned.
Apache CalciteOpen sourceA Java framework with everything a database needs to understand a query (SQL parser, validator, relational algebra and a rule-based, cost-based optimizer) but no storage of its own, which Hive, Flink, Druid, Dremio, Beam and many other systems embed as their SQL front end and planner.
Apache ZeppelinOpen sourceA self-hosted web notebook where each paragraph runs through an interpreter: Spark, Flink, JDBC, Python and more. Maintained, but behind Jupyter and Databricks in reach.
GizmoSQLOpen sourceA database server that wraps DuckDB (or SQLite) and serves it to many clients over Arrow Flight SQL, with TLS and authentication.
HotdataCommercialA managed SQL engine for AI agents, built in Rust on Apache DataFusion and Arrow: each agent gets short-lived “instant databases” to load data into, then runs read-only SQL, vector, full-text and geospatial queries over an HTTP API or CLI.
IbisOpen sourceA Python dataframe API that compiles to SQL, so the same code runs on DuckDB on a laptop and on BigQuery, Snowflake, PostgreSQL or more than 20 other engines.
Spice.ai OSSOpen sourceA single-binary SQL engine in Rust, built on DataFusion and Arrow, that federates queries across databases, warehouses and lakes, keeps hot datasets in a local accelerated copy, and adds search and LLM APIs on top.
VeloxOpen sourceMeta’s open-source C++ execution engine library: it takes an already-optimized query plan and runs it with vectorized operators, and it is the engine inside Presto’s C++ workers (Prestissimo) and Apache Gluten’s native Spark.How it fits with other technologies
What Cloudflare Basin SQL uses
- Cloudflare Basin SQLplans queries from table metadata inCloudflare Basin Catalog
- Cloudflare Basin SQLreads Parquet row groups by byte range fromCloudflare R2
- Cloudflare Basin SQLqueries tables inApache Iceberg
- Cloudflare Basin SQLexecutes each query worker’s share withApache DataFusion
- Cloudflare Basin SQLpasses results between workers asApache Arrow
Query an Iceberg table with Wrangler and the REST API · bash
# token needs Basin SQL read, Basin Catalog read and R2 storage permissions
export WRANGLER_BASIN_SQL_AUTH_TOKEN="<token>"
npx wrangler basin sql query "$WAREHOUSE" \
"SELECT product_id, sum(amount) AS revenue, approx_distinct(user_id) AS buyers
FROM default.ecommerce
WHERE event_type = 'purchase'
GROUP BY product_id ORDER BY revenue DESC LIMIT 10"
curl -X POST \
"https://api.sql.cloudflarestorage.com/api/v1/accounts/$ACCOUNT_ID/basin-sql/query/$BUCKET" \
-H "Authorization: Bearer $WRANGLER_BASIN_SQL_AUTH_TOKEN" \
-H "Content-Type: application/json" \
-d '{"query": "EXPLAIN SELECT * FROM default.ecommerce LIMIT 10"}'See it in a real stack
No architecture uses Cloudflare Basin SQL yet. Drop it into the playground and wire it up yourself.Open playground →Where it came from2025–2026
Cloudflare launched R2 Data Catalog in April 2025, a managed Iceberg catalog inside R2 buckets. It gave tables a reliable catalog but no way to query them: users had to run Spark, Trino or another engine themselves, provisioning clusters just to read their own data.
On 25 September 2025 Cloudflare announced its Data Platform: Pipelines to ingest events, R2 Data Catalog to hold the tables, and R2 SQL, an in-house distributed engine, in open beta and initially focused on filter queries. A deep-dive post the same day explained the design: a planner that prunes with Iceberg statistics, and query workers on Cloudflare’s network running Apache DataFusion over Parquet row groups in R2.
Over the following year it gained joins, aggregations, window functions and the rest of the analytical SQL surface. On 1 October 2026 the platform became generally available under the name Basin, and R2 SQL became Basin SQL; existing R2 SQL APIs keep working for now.
Why it’s built this way
- Prune with Iceberg metadata before reading data
- Object storage holds a table as possibly millions of files, so the cheapest bytes are the ones never read; partition and column statistics let the planner skip whole manifests and files.
- Spread work over Cloudflare’s whole network
- A query may need huge compute for a few seconds and then none, so instead of a cluster, the coordinator borrows healthy servers across the network as query workers.
- Build on DataFusion and Arrow
- DataFusion treats each Parquet row group as a partition to process in parallel with vectorized execution and pushes filters into the scan, and Arrow IPC carries results back to the coordinator over gRPC.
Timeline
- 2025
R2 Data Catalog enters public beta in April
- 2025
Cloudflare acquires Arroyo and opens Pipelines in beta on 10 April, building toward a data platform
- 2025
R2 SQL announced in open beta with the Cloudflare Data Platform on 25 September
- 2026
Generally available and renamed Basin SQL on 1 October
- Cloudflare blog: Just landed, streaming ingestion on Cloudflare with Arroyo and Pipelines (10 April 2025)
- Cloudflare blog: Announcing the Cloudflare Data Platform (25 September 2025)
- Cloudflare blog: R2 SQL, a deep dive into our new distributed query engine (25 September 2025)
- Cloudflare blog: Introducing Cloudflare Basin, an open, serverless data platform, now generally available (1 October 2026)
- Cloudflare changelog: Cloudflare Basin is now generally available (1 October 2026)
Sources6 · facts checked 12 October 2026
- Cloudflare docs: Basin SQL overview (formerly R2 SQL, now generally available)
- Cloudflare docs: Basin SQL, Query data (Wrangler, REST API, tokens)
- Cloudflare docs: Basin SQL, Limitations and best practices
- Cloudflare docs: Basin SQL pricing
- Cloudflare blog: R2 SQL, a deep dive into our new distributed query engine (25 September 2025)
- Cloudflare blog: Introducing Cloudflare Basin, an open, serverless data platform, now generally available (1 October 2026)