Cloud Infrastructureintermediate

AWS Lambda vs Cloudflare Workers

AWS Lambda and Cloudflare Workers compared on pricing, cold starts, runtimes, CPU and memory limits, egress costs and ecosystem for serverless APIs in 2026.

Quick Answer

Cloudflare Workers wins for latency-sensitive HTTP APIs and edge logic: near-zero cold starts, CPU-time billing and free egress. AWS Lambda wins when you need full Node/Python/Java/.NET runtimes, up to 10 GB memory, 15-minute jobs or deep integration with AWS services like SQS, DynamoDB and S3.

Reviewed by TechLogHub Engineering Team. Last updated October 15, 2026. Reflects Lambda's August 2025 INIT-phase billing change, Lambda durable functions and Managed Instances pricing, and Workers' current $5 paid plan with up to 5 minutes CPU time.

Feature comparison of AWS Lambda vs Cloudflare Workers
FeatureAWS LambdaCloudflare Workers
Execution Model
Firecracker microVMs, regional
V8 isolates, global edge
Cold Starts
100 ms–seconds (SnapStart helps)
Near zero (ms)
Languages / Runtimes
Node, Python, Java, .NET, Ruby, containers, custom
JS, TS, Python, Rust/Wasm
Max Memory
10,240 MB
128 MB
Max Execution Time
15 minutes
Up to 5 min CPU (paid); no wall-clock cap on HTTP
Free Tier
1M req + 400k GB-s/mo
100k req/day, 10 ms CPU
Request Pricing
$0.20 per million
$0.30 per million over 10M
Compute Billing
GB-seconds of wall-clock time
CPU milliseconds only
Egress Charges
Standard AWS data transfer rates
Free
Global by Default
Stateful Primitives
Via DynamoDB, ElastiCache, durable functions
Durable Objects, KV, D1
Local Dev Tooling
SAM CLI, LocalStack
Wrangler + workerd

AWS Lambda

AWS's function-as-a-service platform that runs code in Firecracker microVMs per region, triggered by HTTP, queues, streams, schedules and over 200 AWS event sources.

Pros

  • Native triggers from SQS, SNS, EventBridge, S3, DynamoDB Streams, Kinesis and more
  • Full runtimes for Node.js, Python, Java, .NET, Ruby, plus container images and custom runtimes
  • Up to 10,240 MB memory and 10 GB ephemeral storage per function
  • Runs up to 15 minutes per invocation; durable functions for multi-step workflows
  • Arm (Graviton) pricing about 20% cheaper than x86
  • Generous free tier: 1M requests and 400,000 GB-seconds per month

Cons

  • Cold starts of hundreds of ms to seconds, and INIT time has been billed since Aug 2025
  • Billed on wall-clock duration, so waiting on I/O costs money
  • Regional by default; global low latency needs CloudFront, Lambda@Edge or multi-region
  • Data transfer out of AWS is charged separately
  • API Gateway, NAT gateways and CloudWatch logs often cost more than Lambda itself

Best For

Event-driven backends and batch jobs that live inside the AWS ecosystem or need heavy compute and long timeouts.

Cloudflare Workers

Serverless platform that runs JavaScript, TypeScript, Python and WebAssembly in V8 isolates across Cloudflare's global network, with built-in KV, D1, R2, Durable Objects and Queues.

Pros

  • V8 isolates start in milliseconds, so cold starts are effectively a non-issue
  • Deployed to every Cloudflare location by default — no region selection
  • Billed on CPU time, not wall-clock, so time awaiting fetch or DB calls is free
  • No egress or bandwidth charges on the Workers Paid plan
  • Integrated storage: KV, D1 (SQLite), R2, Durable Objects, Queues, Hyperdrive
  • $5/month paid plan includes 10M requests and 30M CPU-ms

Cons

  • 128 MB memory per isolate limits heavy workloads
  • Not full Node.js — compatibility layer covers most but not all npm packages
  • Free plan caps CPU at 10 ms per request
  • Smaller ecosystem of first-party event sources than AWS
  • Language support centres on JS/TS/Wasm; Python support is newer

Best For

Latency-sensitive APIs, edge middleware, auth and full-stack apps where global performance and predictable bills matter more than heavy compute.

Billing model: CPU time vs wall-clock time

The most important difference isn't the headline price per request — it's what counts as billable compute. Lambda bills GB-seconds of wall-clock duration: memory allocated multiplied by how long your function runs, including time spent waiting on a database or third-party API. Since August 2025, initialization (cold start) time is billed too, for all runtimes and packaging types. Workers bills CPU milliseconds. If your handler spends 5 ms computing and 300 ms awaiting fetch() calls, you pay for 5 ms. The paid plan is $5/month including 10 million requests and 30 million CPU-ms, then $0.30 per additional million requests and $0.02 per million CPU-ms. For typical I/O-bound APIs — call a database, transform JSON, return — this makes Workers far cheaper at scale. Lambda's free tier (1M requests and 400,000 GB-seconds per month) is generous for low-traffic apps, and Arm functions cut duration cost by about 20%, but heavy-traffic APIs with slow downstreams pay much more on Lambda. Remember Lambda bills often include API Gateway, CloudWatch logs and data transfer, which Workers doesn't charge separately.

Cold starts and global latency

Workers runs code in V8 isolates rather than containers or microVMs. An isolate spins up in a few milliseconds, and Cloudflare deploys every Worker to its whole network, so requests are served from a location near the user. For latency-sensitive endpoints such as auth checks, redirects, A/B testing or API gateways, that combination is hard to beat. Lambda runs each execution environment in a Firecracker microVM in one region. Cold starts range from roughly 100 ms for small Node or Python functions to seconds for Java or large container images. SnapStart, provisioned concurrency and keeping packages small all help, but provisioned concurrency costs money and SnapStart adds caching and restore charges for non-Java runtimes. To get Lambda close to users worldwide you add CloudFront, use Lambda@Edge or CloudFront Functions, or deploy to several regions — all of which add operational work. If your users are concentrated near one AWS region and your traffic is steady, Lambda's cold starts may be a non-issue; for global consumer traffic, Workers has a structural advantage.

Runtime limits and what fits where

Lambda is a general-purpose compute engine. Functions can use up to 10,240 MB of memory, 10 GB of ephemeral /tmp storage and run for up to 15 minutes. You get full Node.js, Python, Java, .NET and Ruby runtimes, or bring any container image. That makes it suitable for image processing, PDF generation, ML inference on CPU, ETL jobs and anything using native binaries. Workers trades raw capacity for speed. Each isolate gets 128 MB of memory. CPU time defaults to 30 seconds per request on the paid plan and can be raised to 5 minutes, while the free plan caps it at 10 ms. There's no hard wall-clock limit on HTTP requests while the client is connected, and cron triggers and queue consumers can run up to 15 minutes. Workers supports JavaScript, TypeScript, Python and WebAssembly, with a Node.js compatibility layer that covers most but not all npm packages. If your workload needs gigabytes of RAM, native libraries or a JVM, Lambda is the right tool. For request/response logic, Workers' limits rarely bite.

Ecosystem, state and lock-in

Lambda's real moat is AWS. Over 200 services can trigger or be called from functions, and IAM, VPC networking, Step Functions, EventBridge and durable functions let you build complex event-driven systems. If your data is already in DynamoDB, RDS or S3, Lambda sits next to it with no egress cost. Cloudflare has built its own coherent stack around Workers: KV for global key-value reads, D1 for serverless SQLite, R2 for object storage with no egress fees, Durable Objects for strongly consistent stateful coordination (websockets, rate limiting, collaborative apps), Queues, Hyperdrive for pooling connections to existing Postgres, and Workers AI. For greenfield apps this is often enough, and local development with Wrangler and the open-source workerd runtime is pleasant. Both create lock-in. Lambda code that leans on IAM and event payloads is AWS-shaped; Workers code using bindings and Durable Objects is Cloudflare-shaped. Frameworks like Hono, which run on both, reduce the cost of switching for HTTP handlers, but storage and event plumbing remain platform-specific.

Verdict

Choose Cloudflare Workers for HTTP APIs, edge middleware and full-stack apps where global latency and predictable costs matter; CPU-time billing and free egress make it dramatically cheaper for I/O-bound workloads. Choose AWS Lambda when you need more than 128 MB of memory, long-running jobs, full language runtimes, or tight wiring into SQS, DynamoDB, S3 and the rest of AWS. Many teams run both: Workers at the edge for routing, auth and caching, Lambda behind it for heavy or AWS-native processing.

All Comparisons

AWS Lambda vs Cloudflare Workers — FAQ

Common questions answered from the comparison above

Is Cloudflare Workers cheaper than AWS Lambda?

For most HTTP APIs, yes. Workers bills only CPU time and has no egress charges, so time spent waiting on databases or APIs is free; Lambda bills wall-clock GB-seconds plus data transfer and often API Gateway. Lambda can be cheaper for very low traffic that fits within its free tier.

Does Cloudflare Workers have cold starts?

Effectively no. Workers run in V8 isolates that start in a few milliseconds, versus Lambda microVM cold starts that range from about 100 ms to several seconds depending on runtime and package size.

What is the memory limit for Cloudflare Workers?

128 MB per isolate on both the free and paid plans. AWS Lambda allows up to 10,240 MB per function, which is why memory-heavy jobs such as image or PDF processing usually belong on Lambda.

Can Cloudflare Workers run Node.js packages?

Most of them. Workers supports a Node.js compatibility layer that covers common built-ins, so many npm packages work, but packages that need native binaries or unsupported Node APIs will not.

How long can an AWS Lambda function run?

Up to 15 minutes per invocation. For longer multi-step processes, AWS offers Step Functions and Lambda durable functions, which can pause and resume across waits without paying for idle duration.

Get the next comparison by email

One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.