Cloudflare Developer Platform cost model: tiers vs AWS

Per-primitive Cloudflare pricing (Workers, D1, KV, R2, Queues, DOs, Vectorize, Workers AI), tier breakpoints, AWS comparison, and 3 scale scenarios from blog to 100M req/month.

· 11 min read · Đọc bản tiếng Việt
Cost model for the Cloudflare Developer Platform: per-primitive pricing for Workers, D1, KV, R2, Queues, DO, Vectorize and AI, tier breakpoints, AWS Lambda + DynamoDB + S3 comparisons, and zero-egress advantage

TL;DR

Cloudflare Developer Platform has a simple pricing model: generous free tier, flat $5/month Paid plan with generous bundled quotas, overflow billed per-unit at rates cheap compared to AWS. Egress is $0.

Main thesis:

Cloudflare is cheaper than AWS on 3/4 typical primitives (Workers, D1, R2) and similar on 1/4 (KV vs DynamoDB, Queues vs SQS). But the decisive advantage is zero egress and no idle infrastructure cost. For apps < 100M requests/month, usually 5-20x cheaper than AWS. For > 1B, still 10-30x cheaper — mainly thanks to egress and no idle cost.

This post covers: per-primitive pricing in detail, 3 real scenarios (blog, 10k-user SaaS, 100M-req app), breakpoints when the Paid tier is worth it, and when AWS is actually cheaper than Cloudflare.


Who this is for

  • Developers building a side project who need a rough cost idea.
  • Startup teams evaluating migration from AWS.
  • Finance / engineering managers estimating budget for a platform choice.

Recommended prerequisites: Part 1 (overview), Part 13 (Workers AI pricing).

By the end of this post you will:

  • Estimate monthly cost for your app in under 15 minutes.
  • Know the breakpoints for moving from Free to Paid, and Paid to Enterprise.
  • Identify when cost optimization is worth the effort, and when it isn’t.

What this post isn’t about

  • Enterprise pricing in depth: custom bulk discounts, not public. Talk to sales.
  • Cost alert setup: covered in Part 17 (Analytics Engine + Notifications).
  • Comparison with Vercel, Netlify, Railway: focus is AWS, the most common serverless benchmark.

Per-primitive pricing

Per-primitive Cloudflare cost vs AWS equivalent: Workers vs Lambda + API GW, D1 vs RDS, KV vs DynamoDB, R2 vs S3 (zero egress is decisive), Queues vs SQS, Durable Objects vs ElastiCache/self-host Redis, Workers AI vs Bedrock.

Workers (compute)

Free tier:

  • 100k requests/day (≈ 3M/month).
  • 10ms CPU time per invocation.

Paid plan ($5/month):

  • 10M requests/month included.
  • 30s CPU time per invocation.
  • Overflow: $0.30 per 1M requests + $0.02 per 1M CPU-ms above 30ms.

vs AWS Lambda:

  • Lambda: $0.20/1M requests + $0.0000166/GB-s.
    • API Gateway: $1/1M requests (REST) or $3.50/1M (HTTP API).

Workers $0.30/1M vs Lambda+APIGW $1.20-4.20/1M = 3-14x cheaper.

D1 (SQL database)

Free tier:

  • 5M rows read/day, 100k rows written/day.
  • 5GB storage.

Paid plan (included in the $5 bundle):

  • 25B rows read/month, 50M rows written/month.
  • 5GB storage.

Overflow:

  • $0.001 per 1M rows read.
  • $1 per 1M rows written.
  • $0.75 per GB-month storage.

vs DynamoDB on-demand:

  • $0.25/1M reads (eventually consistent), $1.25/1M writes.
  • $0.25/GB storage.

D1 reads are 250x cheaper than DynamoDB. Writes are similar. Storage is 3x more expensive than DynamoDB (but anyone using > 10GB has already migrated off D1).

vs RDS (small instance):

  • t4g.micro: $12/month minimum (not counting storage, backup, multi-AZ).
  • Vertical scaling gets expensive fast.

D1 < $1/month for a blog, $10-30/month for typical SaaS. RDS minimum = $12/month for an idle dev database.

KV (key-value)

Free:

  • 100k reads/day, 1k writes/day.
  • 1GB storage.

Paid:

  • 10M reads, 1M writes /month included.
  • Overflow: $0.50/1M reads, $5/1M writes, $0.50/GB-month.

vs DynamoDB:

  • Reads: KV 2x cheaper ($0.25 vs $0.50).
  • Writes: DynamoDB 4x cheaper ($1.25 vs $5).

KV is eventually consistent. Use for cache, config, flags. Not for transactional data.

R2 (object storage)

Free tier:

  • 10GB storage.
  • 1M Class A operations (PUT, POST, LIST).
  • 10M Class B operations (GET, HEAD).

Paid:

  • $0.015/GB-month storage.
  • $4.50/1M Class A operations.
  • $0.36/1M Class B operations.
  • $0 egress.

vs S3:

  • $0.023/GB-month storage.
  • $5/1M Class A, $0.40/1M Class B.
  • $0.09/GB egress (US, outbound internet).

R2 is 50% cheaper on storage. The egress difference is decisive for media/public APIs.

Example: 1TB R2 storage + 10TB egress/month = R2 $15 vs S3 $923 ($23 + $900). ~60x cheaper.

Queues

Free:

  • 1M operations/month.

Paid:

  • 100M operations/month included.
  • $0.40/1M additional.

vs SQS:

  • $0.40/1M requests (64KB).
  • Larger messages → multiple billing units.

Even. No major advantage or downside.

Durable Objects

Free: limited, typically 1M requests/day + small duration.

Paid:

  • $0.15/1M requests.
  • $12.50/1M GB-s duration (while DO is active).
  • $0.20/GB-month storage.
  • Hibernated WebSocket: $0 duration, storage only.

Comparison: no direct AWS equivalent. Closest = ElastiCache Redis cluster ($15-50/month minimum) + custom coordination code.

1000 active chat rooms: ~$2/month on DO vs $15+/month on Redis. 8x cheaper.

Vectorize

Paid:

  • $0.04/1M dimensions stored/month.
  • $0.01/1M dimensions queried.

vs Pinecone:

  • $70/month minimum (p1.x1 starter).
  • Per-namespace quota.

Vectorize scale-to-zero pricing. Pinecone requires a commitment. 10-70x cheaper at small scale.

Workers AI

Free: 10k neurons/day.

Paid: the $5 bundle includes a neuron allocation.

Per-model pricing (example):

  • Llama 3.1 8B: $0.11/1M input tokens.
  • Llama 3.3 70B: $0.40/1M input.
  • bge-m3 embeddings: $0.012/1M tokens.
  • Flux schnell: $0.005/image.

vs Bedrock Claude Haiku: $0.25/1M input. Workers AI Llama 8B same tier = 2x cheaper.

Frontier models (GPT-4, Claude 4.7, Gemini 2.5 Pro) have no Workers AI equivalent.


Scenario 1: personal blog

Cost curve: Cloudflare flat ~$5-20/month from 100k to 1B requests, AWS (Lambda + API GW + DynamoDB + S3) grows linearly from $0 to $5000 at 1B. Breakpoint 1M: both still free. 10M: CF $5 vs AWS $50. 100M: CF $20 vs AWS $500.

Setup: Astro static blog + a Worker for the subscribe form + Workers AI for popular-posts recommendations.

Traffic:

  • 50k page views/month.
  • 200 form submissions/month.
  • 2k AI suggestion calls/month.

Cloudflare cost:

ServiceUsageCost
Workers (Paid plan)100k req (page + api)$5 (included)
Workers Assets (serving HTML)50k$0 (in bundle)
D1 subscribers table200 writes, 50k reads$0
R2 cover image500MB, 200k fetches$0.01
Workers AI Llama 8B2k calls × 500 tokens$0.10
Vectorize1000 vectors × 1024 dim$0.04
Total$5.15/month

AWS equivalent:

ServiceUsageCost
Lambda100k req$0.02
API Gateway100k req$0.10
CloudFront + S350k pages × 100KB = 5GB$0.45
DynamoDB250 writes, 50k reads$0.05
S3 image500MB, 200k GETs$0.09
Bedrock Claude Haiku2k calls$0.50
OpenSearch (vector)minimum $50/month$50
Total$51.21/month

Cloudflare 10x cheaper thanks to the bundle + no minimum instance.

Pure free tier?

If you skip Workers AI + Vectorize: Cloudflare is $0/month end-to-end.

Key insight

A personal blog is free or $5 total on Cloudflare. AWS minimum is $50+ because of OpenSearch + even a tiny DB instance.


Scenario 2: SaaS startup with 10k users

Setup: a SaaS todo app + admin dashboard + mobile API.

Traffic:

  • 1M API requests/month.
  • 100k user actions/day = 3M D1 writes/month.
  • 30M D1 reads/month.
  • 100GB R2 (user uploads) + 200GB egress.
  • WebSocket chat, 1000 concurrent avg (Durable Objects + Hibernation).

Cloudflare:

ServiceUsageCost
Workers Paid1M req$5 (included)
D130M reads (free in bundle), 3M writes$3 (2M overflow × $1/1M)
R2 storage100GB$1.50
R2 egress200GB$0
R2 ops500k Class B$0.18
Durable Objects1000 rooms × 1h active/day~$5
Total~$14.70/month

AWS:

ServiceUsageCost
Lambda1M req$0.20
API Gateway1M req$1
DynamoDB30M reads, 3M writes$11.25
S3 storage100GB$2.30
S3 egress200GB$18
S3 ops500k GETs$0.20
ElastiCache t3.small Redismin 1 node$50
Socket.io on EC2 t3.small1 instance$15
Total~$98/month

Cloudflare ~7x cheaper. Egress is the big factor (200GB = $18 AWS, $0 CF).


Scenario 3: 100M requests/month app

Setup: API-heavy service, AI features, media upload.

Traffic:

  • 100M Worker requests.
  • 500M D1 reads, 50M writes.
  • 1TB R2 + 10TB egress.
  • 10M Workers AI calls (Llama 8B).
  • 5M Vectorize queries.

Cloudflare:

ServiceUsageCost
Workers100M req (10M free, 90M × $0.30/1M)$27
D1500M read free, 50M write × $1/1M$50
R2 storage1TB$15
R2 egress10TB$0
R2 ops10M$3.60
Workers AI10M × 500 tokens × $0.11/1M$550
Vectorize5M queries × 1024 dim × $0.01/1M$51
Total~$696/month

AWS:

ServiceUsageCost
Lambda100M req$20
API Gateway100M req$100
DynamoDB500M reads, 50M writes$188
S3 storage1TB$23
S3 egress10TB (past the tier)$900
Bedrock Claude Haiku10M × 500 tokens$1250
OpenSearch m6g.large (vector)1 node$150
Total~$2631/month

Cloudflare ~4x cheaper. Egress + AI are the biggest savings.


Breakpoint: when to enable Paid

Cloudflare’s free tier is generous. Breakpoints for flipping on the Paid plan ($5/month):

  1. Workers observability enabled — free plan has limited tracing.
  2. Cron triggers > 30s — free: 30s timeout, paid: 15 minutes.
  3. CPU time > 10ms/req — free limit, paid goes up to 30s.
  4. Requests > 3M/month — free cap.
  5. Using Workers AI — free neuron quota is small.
  6. Need R2 > 10GB — beyond free tier.

Flat $5/month Paid includes:

  • 10M requests.
  • 30s CPU time.
  • 25B D1 row reads, 50M writes.
  • 10GB R2 storage + ops.
  • Workers AI neuron allocation.

Almost always worth it if you’re building a real app.

Enterprise: when?

  • Advanced score-based Bot Management.
  • Enterprise Logpush.
  • Commitment discount (volume negotiated).
  • Custom SLA.
  • Dedicated support.

No fixed number. Typically when spend > $1000/month, contacting sales is worth it.


Cost optimization tips

① Sample observability

Workers Logs at $0.60/1M for 100M requests = $60/month. head_sampling_rate: 0.1 → $6/month.

② Cache aggressively

CDN caching is free. A /api/popular endpoint cached 1h = 10k hits → 10 misses/hour = 240/day vs 240k/day = 1000x cheaper.

③ Aggregate before writing D1

1M events/minute × 1-1 D1 writes = expensive. Buffer into KV / a Queue, aggregate in 5-minute batches → write 1 row instead of 1M rows.

④ R2 lifecycle rules

After 30 days, archive or delete R2 log files. Storage costs compound, nothing auto-cleans.

⑤ Workers AI cache

AI Gateway caches per-prompt. A similar-post recommendation cached 24h = 99% fewer calls.

⑥ Tier down KV

KV reads $0.50/1M. If data rarely changes: cache it in a module-level Worker variable for warm isolates. Free on cache hit.

⑦ Scheduled Workers instead of DO

DOs stay alive = cost. A Scheduled Worker invokes → short execution → idles. If you don’t need WebSockets, Scheduled can replace it.


When AWS is actually cheaper

Not always Cloudflare. Cases where AWS wins:

① Deep commitment discounts

Enterprise AWS deal with 3-year RI at 60% off → compute is cheaper.

② Data-intensive jobs

Spark + EMR for TB/day ETL. Cloudflare has no equivalent. Self-hosting on Workers doesn’t scale.

③ Specialized services

SageMaker custom model training, SES email, Route 53 advanced routing. AWS has broader breadth.

④ Long-lived processes

Workers don’t run 24/7. Need Redis pub-sub 365/7 → self-hosting on EC2 can be cheaper at high throughput.

⑤ Existing lock-in

Migration cost > savings. If an app has been on AWS for 5 years with 200 resources, migrating to Cloudflare doesn’t justify itself unless strategic.


Gotchas

① Free tier is daily, not monthly

Workers Free: 100k req/day, resets at UTC midnight. Burst traffic can burn quota in an hour → rate limit. Paid plan is more predictable.

② D1 write cost is subtle

$1/1M writes is cheap, but 1 UPDATE query touching 1000 rows = 1000 writes. Bulk updates aren’t one billed transaction.

③ R2 Class A is more expensive than Class B

PUT, LIST are 10x more expensive than GET. Don’t send batches of tiny PUTs — concat instead.

④ DO GB-s bill while active

The Hibernation API matters. No hibernation = 24h/day × 30 days = 2.5M GB-s × $12.5/1M = $31/month per DO. Hibernation cuts that 10-100x.

⑤ Egress isn’t free for external AI

Workers AI egress is free. OpenAI/Anthropic through AI Gateway: Worker → Gateway free. Gateway → Provider → Gateway free (Cloudflare network). Provider → user: charged if Cloudflare proxies, different if routed otherwise.

⑥ Vectorize dimension × count

Cost = dim × vectors × rate. 1M vectors × 1024 dim = 1B dimensions stored. Smaller dimension (bge-small 384) cuts cost proportionally.

⑦ Budget alerts

No built-in hard cap. 100x overflow still charges. Set up Notification cost alerts early (Part 17).

⑧ No reserved pricing

AWS RIs give 40-60% savings. Cloudflare enterprise is negotiated, not public. Small/medium teams don’t benefit.


15-minute estimate template

Not perfectly accurate, but catches 80%:

Workers: monthly_req / 1e6 × $0.30 (overflow after 10M)  → $X
D1: reads / 1e6 × $0.001 + writes / 1e6 × $1  → $Y
R2: storage_GB × $0.015 + ops / 1e6 × ($4.50 class A + $0.36 class B)  → $Z
Workers AI: tokens / 1e6 × $0.11 (Llama 8B)  → $W
Vectorize: dim_stored / 1e6 × $0.04 + query / 1e6 × $0.01  → $V
DO: active_GB_s / 1e6 × $12.50 + storage_GB × $0.20  → $U

Total ≈ X + Y + Z + W + V + U + $5 (Paid plan).

Compare AWS: similar but rates × 3-10x.


Production checklist

  • Enable Paid plan ($5/month) if building a real app.
  • Sampling observability tuned to traffic.
  • Cache headers + CDN for static + cacheable API data.
  • Log cost budget alerts (Notifications).
  • R2 lifecycle rules for logs, expired backups.
  • DO hibernation enabled for WebSockets.
  • AI Gateway cache for LLM calls.
  • Aggregate D1 writes (buffer + batch), not 1-1 per event.
  • Embedding dimension as small as still gives quality (bge-base 768 instead of bge-m3 1024 if OK).
  • Review cost monthly, identify unexpected spend.
  • Scope API tokens by least privilege (Part 12) — reduce cost-abuse risk from leaked tokens.

Wrap-up

The Cloudflare developer platform is cheaper than AWS in most scenarios by 5-30x, mainly thanks to bundled includes + zero egress + no idle cost. For medium-scale blogs/SaaS, total < $50/month with room to spare. For 1B request/month apps, < $1000/month.

AWS still wins for specialized workloads, data-intensive batch jobs, and deep commitment discounts. But for edge-first apps, Cloudflare is the reasonable default.

Part 20 (final): Migration from AWS/Vercel to Cloudflare — practical playbook for moving Lambda → Worker, S3 → R2, DynamoDB → D1. Closes the series.


References