Cloudflare Workers moved from isolated edge function to complete edge platform during 2023-2024. The current stack combines Workers (compute) + KV (global key-value) + D1 (distributed SQLite) + R2 (S3-compatible object storage) + Durable Objects (stateful) + Queues + Workers AI (edge GPU inference). This article analyses when that stack seriously competes with AWS and when AWS remains the right answer.

Key takeaways

  • V8 isolates with sub-5 ms cold starts deliver sub-50 ms p50 latency to users from any of 330+ PoPs.

  • R2 eliminates egress fees, the most differentiated cost advantage versus S3.

  • D1 (edge SQLite) reached GA in 2024 and covers small-to-mid CRUD apps well.

  • Durable Objects are the right primitive for persistent WebSockets, global rate limiting, and collaborative apps.

  • The 30-second request limit blocks long-running compute: that is the most important structural constraint.

The stack components

Workers: compute

  • V8 isolates, cold start under 5 ms.

  • Over 330 global PoPs.

  • $5/mo base price, $0.30 per million requests.

  • JavaScript, TypeScript, Rust (via Wasm), Python in beta.

KV: global key-value

  • Eventual consistency; millisecond read latency.

  • Natural use case: distributed cache, session tokens.

D1: edge SQLite

  • Replicated SQLite. Full SQL. GA since 2024.

  • Pricing based on rows read and written.

  • Use case: small-mid CRUD apps. Centralised writes, read replicas at each PoP.

R2: object storage

  • S3-API compatible. No egress fees, a massive advantage versus AWS S3.

  • Approximately $0.015/GB/mo.

  • Use case: images, videos, static files.

Durable Objects

  • Stateful edge compute. Strong per-object consistency. Persistent WebSockets.

  • Use case: chat rooms, collaborative apps, global rate limiting.

Workers AI

  • Edge GPU LLM inference (Llama, Mistral, others). Pay per token.

  • Use case: chatbots, summarisation, image generation.

Cloudflare vs AWS for edge

Aspect Cloudflare AWS
Regions 330+ PoPs ~30 regions
Cold start <5 ms 100 ms+ (Lambda)
Egress Free (R2) $0.09/GB
Edge DB D1 (SQLite) N/A (DynamoDB Global is different)
Execution limit 30s 15 min (Lambda)
Ecosystem Growing Mature and massive

Cloudflare wins on simple edge, latency and egress cost. AWS wins on enterprise ecosystem, mature managed databases, and compute-intensive or long-running workloads. The Fastly Compute article covers how another provider approaches the same space with more mature enterprise contracts.

Cases where Cloudflare fits

  • Global edge APIs: user near any PoP, sub-20 ms latency.

  • Next.js / Astro / SvelteKit sites: see SvelteKit 1.0 and its real adoption for the adapter-cloudflare integration.

  • Chat apps: Durable Objects with persistent WebSockets are exactly built for this.

  • Edge image optimisation: Workers + R2 eliminates the origin round-trip.

  • Global rate limiting: Durable Objects with strong per-object consistency.

  • Rapid prototyping: setup in minutes, negligible cost at low volumes.

Cases where AWS still wins

  • Intensive or long-running compute: Lambda accepts up to 15 minutes; Workers has a 30s limit.

  • Mature managed DBs: RDS PostgreSQL versus D1, which is young.

  • Streaming data: Kinesis, MSK.

  • ML platforms: SageMaker.

  • Complex IAM: AWS permission model is far richer.

Deployment with Wrangler

npm install -g wrangler
wrangler login

# Create worker
wrangler init my-app

# Deploy
wrangler deploy

# Tail logs
wrangler tail

Seconds-long deployment. No containers, no buckets to configure first.

Workers AI in practice

export default {
  async fetch(request, env) {
    const response = await env.AI.run("@cf/meta/llama-3-8b-instruct", {
      messages: [{ role: "user", content: "Hi" }],
    });
    return Response.json(response);
  },
};

LLM inference with under-1s edge latency. No GPU management. Pay per token. It complements architectures where the main model is accessible via LLM proxies like LiteLLM to manage multiple providers.

Honest limitations

  • 30s max request: no long-running compute.

  • Read-only D1 replicas: writes remain centralised.

  • Durable Objects: limited concurrency per object.

  • Python in beta: not production-ready without prior validation.

  • Less rich debugging than serverful environments.

  • Bundle size limit (~1-10 MB depending on plan).

Real prices

Mid-size app (1M users/mo, 10M requests):

  • Workers: $5 base + negligible.

  • KV (1M reads): $0.50.

  • D1 (1M reads): ~$1.

  • R2 (10 GB storage): $0.15.

  • Approximate total: ~$10/mo.

The AWS equivalent runs $50-200/mo for a similar workload.

This piece covers the 2024 stack. For where the platform stands today, continue with Cloudflare Workers in 2025.

Conclusion

The Cloudflare edge stack in 2024 is a real AWS alternative. For edge-native applications (global, latency-sensitive, medium complexity) it is simpler, cheaper, and faster to operate. For enterprise workloads with complex compliance, specific ecosystems, or intensive compute, AWS remains the primary option. The gap closes every month: it is worth evaluating Cloudflare for new projects before defaulting to AWS.

Read this article in Spanish

Frequently asked questions

How much would a mid-size app cost per month on Cloudflare Workers versus AWS?

About $10 a month for an app with 1M users and 10M requests per month. That is the $5 Workers base plus a negligible request charge, $0.50 for 1M KV reads, around $1 for 1M D1 reads and $0.15 for 10 GB in R2. The same workload on AWS runs $50-200 a month, largely because of the $0.09/GB egress fee that R2 does not charge.

Can I run long or compute-intensive tasks on Workers?

No: the 30-second request limit is the platform's most important structural constraint, versus the 15 minutes AWS Lambda accepts. For intensive or long-running compute, streaming data (Kinesis, MSK), ML platforms (SageMaker) or complex IAM, AWS still wins. Other limitations to keep in mind: Python is still in beta, D1 replicas are read-only with centralised writes, and the bundle is limited to roughly 1-10 MB depending on plan.

Which primitive should I use for persistent WebSockets or global rate limiting?

Durable Objects. They are stateful edge compute with strong per-object consistency and persistent WebSocket support, exactly what chat rooms, collaborative apps and global rate limiting need. KV is not suited to this because it is eventually consistent, designed for distributed caches and session tokens. Keep in mind that Durable Objects have limited concurrency per object.

Sources

  1. Cloudflare Workers, official pricing
  2. Cloudflare D1 reaches GA (SD Times, April 2024)
  3. AWS Lambda execution limits, official docs
  4. Cloudflare global network