---
title: "Cloudflare Data Platform - Ingest, Catalog & Query"
description: "Build analytics-ready data warehouses and lakehouses on R2. Stream events via Pipelines, catalog tables with Apache Iceberg, and query with R2 SQL or any compatible engine—all without egress fees."
url: "https://www.cloudflare.com/products/data-platform"
---

# Data Platform

> Build analytics-ready data warehouses and lakehouses on R2. Stream events via Pipelines, catalog tables with Apache Iceberg, and query with R2 SQL or any compatible engine—all without egress fees.

## Benefits

### Zero egress fees

Query your data from any cloud, data platform, or region without incurring transfer costs. R2 never charges for egress.

### Always fast

Automatic table maintenance, such as compaction and snapshot expiration, keeps your data performant without the need for scheduling manual maintenance tasks.

### Serverless ingestion

Stream and process events via HTTP endpoints or Workers bindings. No Apache Kafka, no Apache Flink, no infrastructure management.

### SQL at the edge

Query Iceberg tables directly with R2 SQL or the wrangler CLI. Distributed compute, automatic file pruning.

### No infrastructure

No servers to provision, no clusters to manage. Just define a schema, stream data, and query.

### Open table format

Apache Iceberg tables means your data is accessible by your favorite query engines—Apache Spark, Snowflake, Trino, DuckDB, and more—via R2 Data Catalog's standard Iceberg REST API.

## Use Cases

### Log analytics at scale

Ingest server logs, application events, and telemetry data. Query with SQL to debug issues, track performance, and build operational dashboards.

### Business intelligence pipelines

Stream clickstream data, user events, and transactions. Connect your BI tools directly to Iceberg tables for real-time reporting.

### ETL without the infrastructure

Transform data with SQL at ingestion time. Filter, enrich, and validate before writing to storage—no separate ETL service required.

### Multi-cloud analytics

Store data once in R2, query from anywhere. Run Spark jobs in AWS, Snowflake queries from your data warehouse, or DuckDB locally—all hitting the same tables.

## Code Examples

### Stream data via Pipelines

Send events to [Pipelines](https://developers.cloudflare.com/pipelines/) via HTTP endpoints or Workers bindings. Data is automatically written to Iceberg tables in R2.

```typescript
export default {
  async fetch(request, env, ctx): Promise<Response> {
    // Stream events to Pipelines
    await env.ANALYTICS.send([{
      user_id: "user_12345",
      event_type: "purchase",
      product_id: "widget-001",
      amount: 29.99,
    }]);

    return new Response("Event ingested");
  },
} satisfies ExportedHandler<Env>;
```

### Query Iceberg tables directly

Use [R2 SQL](https://developers.cloudflare.com/r2-sql/) to query your data with standard SQL. Distributed compute and automatic file pruning for fast analytics.

```terminal
# Query your Iceberg tables directly
npx wrangler r2 sql query "my-warehouse" "
SELECT 
    user_id,
    event_type,
    SUM(amount)
FROM default.events
WHERE event_type = 'purchase'
GROUP BY user_id, event_type
LIMIT 10"
```

### Use any Iceberg-compatible engine

Connect Spark, Snowflake, Trino, DuckDB, or any engine that supports Iceberg. R2 Data Catalog exposes a [standard REST API](https://developers.cloudflare.com/r2/data-catalog/config-examples/).

```python
from pyspark.sql import SparkSession

# Connect to R2 Data Catalog
spark = SparkSession.builder \
  .appName("R2Analytics") \
  .config("spark.sql.catalog.r2", "org.apache.iceberg.spark.SparkCatalog") \
  .config("spark.sql.catalog.r2.type", "rest") \
  .config("spark.sql.catalog.r2.uri", CATALOG_URI) \
  .config("spark.sql.catalog.r2.warehouse", WAREHOUSE) \
  .config("spark.sql.catalog.r2.token", TOKEN) \
  .getOrCreate()

# Query your data—same tables, any engine
df = spark.sql("SELECT * FROM r2.default.events")
df.show()
```

## Resources

- [Full Documentation](https://developers.cloudflare.com/r2/data-catalog): Complete technical documentation
- [Get Started](https://dash.cloudflare.com/sign-up): Sign up and start building
- [Pricing](/plans.md): See pricing details

## Related Products

- [Artifacts](/products/artifacts.md): Git-native versioned storage
- [Cache Reserve](/products/cache-reserve.md): Persistent caching for static content
- [D1](/products/d1.md): Serverless SQL
- [Hyperdrive](/products/hyperdrive.md): Global databases

---

*This is a markdown version of [https://www.cloudflare.com/products/data-platform](https://www.cloudflare.com/products/data-platform) for AI/LLM consumption.*
