Cloud Parts

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
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, named WINDOW, UNNEST, PIVOT or LATERAL
  • 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 Arrow AceroExperimentalOpen sourceThe streaming execution engine inside Arrow’s C++ library: you hand it an exact plan of nodes (scan, filter, project, aggregate, join, sort) and it streams Arrow record batches through them, with no SQL parser or optimizer of its own.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 DataFusionOpen sourceA query engine library in Rust, built on Arrow, that other projects embed and extend to build their own databases and data tools.+1 Apache DataFusion CometApache HadoopOpen sourceThe project that made big-data clusters normal: a distributed file system (HDFS), a cluster scheduler (YARN) and the MapReduce engine.Apache HiveOpen sourceThe first SQL engine for Hadoop, and the source of the Hive Metastore, the table catalog that Trino, Spark, Impala and Flink still read.Apache ImpalaOpen sourceAn MPP SQL engine in C++ for interactive queries over Hive tables on HDFS, Kudu, Iceberg and object storage; built and mainly sold by Cloudera.Apache PigDormantOpen sourceA step-by-step scripting language, Pig Latin, that compiles to MapReduce, Tez or Spark jobs on Hadoop. Still released, but the project calls itself dormant.Apache SparkOpen sourceThe general-purpose distributed engine for large batch jobs, streaming and machine learning, in Python, SQL, Scala, Java or R.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.chDBOpen sourceThe ClickHouse engine packaged as a library: run ClickHouse SQL inside a Python, Go, Rust or Node.js program, with no server.DuckDBOpen sourceAn in-process analytical SQL database: a library with no server that queries Parquet, CSV, Iceberg and S3 directly.GizmoSQLOpen sourceA database server that wraps DuckDB (or SQLite) and serves it to many clients over Arrow Flight SQL, with TLS and authentication.GlareDBDormantOpen sourceA small, embeddable SQL engine in Rust for querying Parquet and CSV files locally, over HTTP or in S3 and GCS, from a CLI, Python or the browser. It began as a DataFusion-based federated query service and was rewritten in 2025 on its own engine, and it has had no release since June 2025.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.PolarsOpen sourceA DataFrame library with a Rust query engine underneath: you write Python (or Rust, SQL, Node.js, R) and it plans, optimises and runs the query on every core, streaming data bigger than memory.Presto (PrestoDB)Open sourceFacebook’s distributed SQL engine, now governed by the Linux Foundation, moving its workers from Java to C++ on Velox. Trino is its 2019 fork.RayforceOpen sourceA small embeddable engine in pure C that runs columnar analytics, graph traversals and recursive Datalog queries in one optimised plan.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.TrinoOpen sourceA distributed SQL engine that queries data where it lives, from Iceberg tables on S3 to a live PostgreSQL database, in one query.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

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

  1. 2025

    R2 Data Catalog enters public beta in April

  2. 2025

    Cloudflare acquires Arroyo and opens Pipelines in beta on 10 April, building toward a data platform

  3. 2025

    R2 SQL announced in open beta with the Cloudflare Data Platform on 25 September

  4. 2026

    Generally available and renamed Basin SQL on 1 October

Sources6 · facts checked 12 October 2026

Improve this page on GitHub