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 Reads50,000,000
Free: 150M/mo. Paid: 25 Billion included, then $0.001/1M.
Monthly Row Writes5,000,000
Free: 3M/mo. Paid: 50 Million included, then $1.00/1M.
Total Database Storage4 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).
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:
Single-Primary Write Serialization: SQLite is single-writer. High-concurrency write bursts (>50 writes/sec) should be staged in Cloudflare Queues or KV before committing to D1 to prevent lock contention.
Database Size Limit (10 GB): Individual D1 databases support up to 10 GB of storage. Large multi-terabyte analytical logs should be routed to Cloudflare R2 object storage in Parquet format.
Automated Time-Travel Snapshots: Cloudflare D1 provides automated point-in-time recovery for 30 days, allowing immediate rollbacks via `wrangler d1 time-travel restore`.
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.
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.
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.