CheckAPICost 2026 Engine
Serverless Edge SQLite • 2026 Official Telemetry

Cloudflare D1 Pricing Explained: Row Reads, Writes & Storage Calculator

Complete breakdown of Cloudflare D1 serverless database costs: Free tier limits (5M reads/day), Workers Paid tier ($5/mo for 25 billion reads), $1.00/1M writes, edge read replication latency, and database storage limits.

Direct Summary: How Cloudflare D1 Pricing Works

Cloudflare D1 is one of the most cost-effective relational databases in existence for read-heavy workloads. On the Workers Paid Plan ($5/month), you receive 25 billion row reads and 50 million row writes every month. Extra row reads are virtually free at $0.001 per 1 million rows, extra writes cost $1.00 per 1 million rows, and storage beyond the included 5 GB costs $0.75 per GB/month.

Interactive Cloudflare D1 Cost Estimator (2026)

Calculate your monthly bill based on row reads returned, row writes executed, and total database size.

Monthly Row Reads 50,000,000
Free: 150M/mo. Paid: 25 Billion included, then $0.001/1M.
Monthly Row Writes 5,000,000
Free: 3M/mo. Paid: 50 Million included, then $1.00/1M.
Total Database Storage 4 GB
5 GB included on Paid, then $0.75/GB-month.
Base Subscription (Workers Paid) $5.00
Row Reads Overage $0.00
Row Writes Overage $0.00
Storage Overage $0.00
Estimated Monthly Bill $5.00
Plan Recommendation: Workers Paid ($5.00/mo) covers all operations.

How Cloudflare D1 Measures Row Operations

Cloudflare D1 is built on SQLite. Unlike Postgres or MySQL which bill on provisioned hardware (vCPU cores and RAM) or Aurora Serverless which bills on active ACU hours, D1 bills directly on rows scanned and rows mutated.

Row Reads: Every row inspected during a SELECT query counts as a row read. If you execute SELECT * FROM users WHERE email = '[email protected]' without an index on email, SQLite must scan all 1,000,000 rows in the table—costing you 1,000,000 row reads! Adding a proper index drops that cost to exactly 1 row read.

Row Writes: Every row inserted, updated, or deleted counts as a row write. Because writes must achieve consensus and replicate across durable storage, writes cost significantly more ($1.00 per 1M) than reads ($0.001 per 1M).

D1 Free Tier vs Workers Paid Plan (2026)

Resource Metric Workers Free Plan Workers Paid Plan ($5/mo)
Monthly Base Fee $0 / month $5.00 / month
Included Row Reads 5,000,000 / day (~150M/mo) 25,000,000,000 / month
Row Reads Overage Hard cutoff $0.001 per 1,000,000 rows
Included Row Writes 100,000 / day (~3M/mo) 50,000,000 / month
Row Writes Overage Hard cutoff $1.00 per 1,000,000 rows
Included Storage 5 GB total 5 GB included ($0.75/GB over)
Max DB Size 500 MB per database 10 GB per database
Max Databases 10 databases 50,000 databases

Cloudflare D1 Architecture: SQLite Read Replicas & Serverless Row-Operation TCO

Cloudflare D1 is a distributed serverless relational database built on SQLite that integrates natively with Cloudflare Workers. While traditional relational cloud databases (AWS Aurora, Google Cloud SQL) cost $50 to $300+/month for provisioned compute, Cloudflare D1 charges strictly on row operations: $0.001 per 1 million row reads and $1.00 per 1 million row writes with 5 million reads and 100,000 writes included free daily on the Workers Paid plan ($5/mo).

Monthly Activity Cloudflare D1 Cost AWS Aurora Serverless v2 Supabase Pro ($25/mo) Edge Read Latency (Global)
10M Reads / 500k Writes $5.50 / month (Paid base + $0.50) $48.50 / month (0.5 ACU baseline) $25.00 / month <15 ms (Read Replicas)
100M Reads / 5M Writes $10.00 / month $86.40 / month $25.00 / month <15 ms
1B Reads / 50M Writes $55.00 / month $240.00 / month $65.00 / mo (Compute upgrade) Sub-millisecond local SQLite cache

Production Pipeline: D1 Edge Query Execution in Cloudflare Worker

Executing prepared parameterized queries on D1 with automated read-replication routing:

export interface Env {
  DB: D1Database;
}

export default {
  async fetch(request: Request, env: Env): Promise<Response> {
    const url = new URL(request.url);
    const userId = url.searchParams.get('userId');

    // Prepared statement prevents SQL injection and batches row read charges
    const { results } = await env.DB.prepare(
      "SELECT model_name, token_count, created_at FROM api_usage WHERE user_id = ? ORDER BY created_at DESC LIMIT 20"
    ).bind(userId).all();

    return Response.json(results);
  }
};

Production Best Practices & Storage Constraints

Read Replication Economics & Global Edge SQLite Concurrency

Cloudflare D1 redefines serverless relational persistence by embedding distributed SQLite instances across Cloudflare's 300+ global edge locations. While write transactions route to the primary database coordinator to guarantee ACID serializability, read queries execute locally from distributed read replicas without leaving edge memory. Understanding D1's unit billing metrics (billed per row read and row written) is essential to avoiding bill shock when executing unindexed full table scans across massive datasets.

Cloudflare D1 Query Volume & Operational Cost Scaling

Monthly Traffic Tier Rows Read / Month Rows Written / Month Storage (GB) Estimated Monthly Bill
Workers Free Tier Up to 5,000,000 Up to 100,000 0.5 GB $0.00 (Included)
Workers Paid Base ($5/mo) 25,000,000 included 50,000,000 included 5 GB included $5.00
High Scale Production 1,000,000,000 200,000,000 50 GB $185.00

Production Worker TypeScript D1 Binding

Execute indexed queries with parameterized statements to ensure optimal row scan efficiency:

interface Env {
  DB: D1Database;
}

export default {
  async fetch(request: Request, env: Env): Promise<Response> {
    const url = new URL(request.url);
    const userId = url.searchParams.get("userId");

    // Indexed lookup reads exactly 1 row, avoiding costly full table scans
    const user = await env.DB.prepare(
      "SELECT id, email, tier, credits FROM users WHERE id = ?"
    ).bind(userId).first();

    return Response.json(user ?? { error: "User not found" });
  }
};

Cloudflare D1 Global Edge Read Replication & High Availability

Cloudflare D1 features automated read replication across Cloudflare's worldwide points of presence, achieving median read latencies under 12 milliseconds for edge workers. Write replication converges within 100 milliseconds via Raft consensus, ensuring high availability (99.99% SLA) and reliable multi-region durability without dedicated database administrators.

4.9 out of 5
★★★★★
Developer Community Benchmark Rating
Verified across 96 community production token & cost audits
Rate this benchmark:

Serverless SQL at the Edge: Cloudflare D1 Architecture & Cost Model

Cloudflare D1 is a globally distributed serverless relational database built natively on SQLite and deeply integrated with Cloudflare Workers. While traditional relational databases (PostgreSQL, MySQL) require client TCP connections to route back to a centralized cloud region (e.g. AWS us-east-1), D1 automatically creates read replicas across Cloudflare's edge network in over 330 cities worldwide.

D1's pricing model completely changes the economics of relational storage: you pay strictly for Row Reads, Row Writes, and Storage GBs, with no hourly instance charges or idle compute minimums.

Cloudflare D1 Pricing Tiers & Unit Rates

Billing Dimension Workers Free Plan Workers Paid ($5/mo Base) Overage Rates
Row Reads 5,000,000 rows / day 25,000,000,000 rows / mo $0.001 per 1,000,000 rows
Row Writes 100,000 rows / day 50,000,000 rows / mo $1.00 per 1,000,000 rows
Storage Capacity 5 GB total 10 GB included $0.75 per GB / month
Databases Allowed 10 databases 50,000 databases Multi-tenant per-user isolation