AWS Lambda Functions vs Cloudflare Workers
Compare categories, runtimes, pricing, regions, infrastructure, and platform trade-offs.
Updated
Which should you choose?
Choose AWS Lambda when your work is driven by AWS events, needs close integration with AWS services and IAM, or requires a regional function execution model with managed concurrency controls. Choose Cloudflare Workers when your application is primarily handling HTTP requests, routing, middleware, or API logic distributed across Cloudflare’s edge network.
This is not simply a choice between two ways to host the same JavaScript function. Lambda and Workers differ in the events that invoke them, the code they run, how they scale, and what execution time means for both operations and billing.
Event integration versus request-path execution
Lambda is a natural fit for S3 events, queues, data streams, and other AWS-managed event flows. AWS provisions function execution environments as demand changes, and regional account concurrency is a planning constraint. It provides reserved concurrency to protect or bound functions and provisioned concurrency to reduce initialization delays, with additional cost for provisioned capacity. AWS Lambda concurrency
Workers is useful for responding to traffic at the edge and for building APIs, middleware, and application logic in the Cloudflare environment. It also supports scheduled and queue-triggered work, so edge does not mean HTTP-only. But Workers should not be treated as a drop-in replacement for every AWS event-source integration. Cloudflare Workers documentation
Runtime and dependency boundaries
Lambda provides managed language runtimes and also supports deployment from container images. Its execution environments are regional and can be reused between invocations, with initialization latency when a new environment starts. Workers uses an isolate-oriented runtime, with its own memory, compatibility, and CPU-time constraints. A dependency requiring a conventional server process, a native binary, or a specific runtime API needs explicit compatibility testing rather than a generic platform checkmark. AWS Lambda execution environments · Cloudflare Workers limits
Understand the billing units
Standard Lambda on-demand usage is billed by requests and execution duration at the allocated memory size, subject to free allowances and regional rates. Provisioned concurrency and supporting AWS services can add charges. Workers Paid bills requests and CPU time, with included usage and an account minimum; time waiting for external I/O is not billed like active CPU time. A simple comparison of requests per month will not determine which is cheaper. Workload shape, memory, CPU use, execution time, and dependencies all matter. AWS Lambda pricing · Cloudflare Workers pricing
Decision boundary: Choose Lambda when AWS event integration and regional execution are the center of the architecture. Choose Workers when distributed HTTP handling and the Cloudflare runtime are the center. For an edge API that must repeatedly access a single AWS-region database, model the network path before expecting a latency improvement from moving execution to the edge.
Comparison facts
Platform
Development & Execution
Pricing
- Requests — $0.20 · per 1 million requests
- Requests — $0.30 · per additional million requests
- x86 execution duration — $0.0000166667 · per GB-second
- CPU time — $0.02 · per additional million CPU milliseconds
Infrastructure & Availability
- Amazon Web Services
- Own Network
- Execution: Single Region
- Execution: Multi Region
- Scope: Regional
- Execution: Edge
- Scope: Global
- 38 Regions
- 348 Locations