Skip to content

Edge Platforms Compared: Cloudflare Workers vs Lambda at Edge vs Fastly

Edge platform comparison: Cloudflare Workers vs Lambda at Edge vs Fastly Compute at Edge, covering V8 isolates, CloudFront coupling, WASM runtime, pricing, and use-case fit.

Comparison diagram of Cloudflare Workers versus Lambda@Edge across runtime, cold start, locations.

An edge platform is a serverless runtime that executes application logic at network edge nodes distributed close to end users, cutting round-trip latency without requiring traditional origin server deployments. Three platforms now dominate this space: Cloudflare Workers, Lambda at Edge, and Fastly Compute at Edge. Each implements a distinct execution model, couples differently to existing CDN infrastructure, and fits a different engineering context. The choice between them turns on whether you already operate inside a specific cloud stack, what trigger model your edge logic needs, and how much flexibility you want in the runtime itself. Background on the broader architectural tradeoff between proximal and centralized compute is in the edge computing vs cloud computing trade-offs explainer.

What Edge Compute Platforms Do

An edge platform intercepts HTTP requests at distributed network nodes and executes application logic before the request reaches a centralized origin server. This differs from a standard content delivery network (CDN) cache, which stores static assets at edge locations but forwards dynamic requests back to origin unchanged. An edge platform adds a programmable serverless runtime layer at those same edge locations, so request routing decisions, header manipulation, authentication checks, and personalization logic can all run within milliseconds of the end user rather than hundreds of milliseconds away at a data center.

Fastly Fiddle running Compute JavaScript code that adds a field to a JSON response, with the edge request result
Fastly Fiddle · Credit: Fastly

The shared problem space across all three platforms is latency reduction and origin offload: processing a request at the edge means fewer round trips, lower time-to-first-byte, and reduced origin compute costs. Where they diverge is in the runtime isolation model, the trigger types they support, the languages they accept, and how tightly they bind to an existing CDN layer. Understanding those differences before choosing a platform avoids significant rework later.

Cloudflare Workers: V8 Isolates at Global Scale

Cloudflare Workers is the edge platform that runs JavaScript (and other languages via WebAssembly) inside V8 isolates distributed across Cloudflare's global network, with near-zero cold start latency because isolates share a single process rather than spinning up a container. The V8 isolate model separates individual worker contexts using memory boundaries within one V8 engine process, eliminating the container initialization overhead that causes cold start delays in traditional serverless runtimes. Workers run within strict CPU-time and memory limits documented on the Cloudflare Workers platform limits page; consult that page for exact current thresholds before building workloads that approach those ceilings.

The ecosystem around Cloudflare Workers extends the platform well beyond simple request interception. Workers KV provides a globally distributed key-value store for persisting lightweight state at the edge. Durable Objects add coordination primitives for workloads that need consistent state, such as rate limiters or real-time collaboration sessions. The pricing model includes a free tier with a daily request allowance; paid usage is billed per request and per duration, with details on the Cloudflare Workers pricing page. The Route 53 vs Cloudflare DNS and network comparison covers how the broader Cloudflare network fits into DNS and routing decisions for teams evaluating the full platform.

  • Execution model: V8 isolates within a shared process; near-zero cold start latency
  • Language support: JavaScript and TypeScript natively; other languages via WebAssembly compilation
  • Trigger types: HTTP requests, scheduled cron events via Cron Triggers, and Durable Objects messaging
  • Storage integrations: Workers KV (key-value), Durable Objects (consistent state), R2 (object storage)
  • Free tier: daily request allowance included; see pricing page for current limits

Lambda at Edge: CloudFront-Coupled Serverless

Lambda at Edge is the edge platform that extends AWS Lambda execution to CloudFront edge nodes, firing functions in response to four CloudFront event types: viewer request, viewer response, origin request, and origin response. This coupling to CloudFront is the defining characteristic of the service. The AWS option is not a standalone global edge runtime that you can deploy independently; it requires an active CloudFront distribution and executes only when that distribution receives traffic. Functions are authored in the us-east-1 AWS region and replicated automatically to CloudFront edge locations as traffic demands.

The execution model differs meaningfully from Cloudflare Workers. Lambda at Edge functions run in standard Lambda containers, which means cold start behavior follows the Lambda pattern rather than the near-zero overhead of an isolate. Memory limits, package size constraints, and maximum execution duration for each of the four event types are defined in the AWS Lambda at Edge function restrictions documentation; those constraints differ by event type, so review them before architecting a solution. An overview of the full trigger and deployment model is in the AWS Lambda at Edge developer guide. The CloudFront-coupled option carries no persistent free tier; usage is billed per request and per duration against standard CloudFront and Lambda pricing.

  • Execution model: Standard Lambda containers at CloudFront locations; cold start behavior follows Lambda patterns
  • Trigger types: Four CloudFront event types: viewer request, viewer response, origin request, origin response
  • Language support: Node.js and Python (the subset supported by CloudFront-triggered Lambda)
  • Coupling: Requires an active CloudFront distribution; not deployable as a standalone edge runtime
  • Free tier: No persistent free tier; billed per request and duration on top of CloudFront costs

Fastly Compute at Edge: WASM-Powered Flexibility

Fastly Compute at Edge is the edge platform that runs compiled WebAssembly modules on Fastly's edge network, allowing teams to write edge logic in Rust, JavaScript, Go, or any other language with a WASM compilation target. The WebAssembly (WASM) runtime model gives Compute at Edge an unusual degree of language flexibility relative to the other two platforms. Rather than being constrained to a JavaScript engine or a Lambda-supported language list, any language toolchain that emits valid WASM can produce an edge function deployable on Fastly's network. Fastly provides official SDKs for Rust and JavaScript/AssemblyScript, along with a browser-based IDE called Fiddle that allows testing edge functions without a local build environment. Edge data storage capabilities for persisting state at the edge are documented on the Fastly edge data storage product page.

Fastly logo in red on a white rounded rectangle, with red lines and dots on a light gray background.
Credit: Fastly

Compute at Edge is distinct from Fastly's earlier VCL-based (Varnish Configuration Language) CDN configuration model. VCL configs are declarative and handled within Fastly's existing CDN layer; Compute at Edge replaces that with a code-driven approach where compiled WASM modules execute at the edge. The two approaches can coexist in a Fastly deployment, but Compute at Edge is the path for teams that need programmatic edge logic rather than configuration-driven caching rules. Fastly's serverless runtime carries usage-based pricing with no standalone permanent free plan comparable to Cloudflare's daily allowance.

  • Execution model: Compiled WebAssembly modules; very low cold start overhead compared to container-based runtimes
  • Language support: Any WASM-capable language; official SDKs for Rust and JavaScript/AssemblyScript; Go also viable
  • Trigger types: HTTP request-driven, initiated at Fastly's global edge network locations
  • Tooling: Fastly CLI, Fastly Fiddle (browser-based IDE), local WASM compilation via language toolchains
  • Free tier: Usage-based pricing; no standalone permanent free plan

Platform Comparison: Runtime, Limits, and Pricing

Each edge platform differs most sharply in its execution model, CloudFront coupling, and cost structure rather than in raw feature count. The table below summarizes the key dimensions across the three platforms. Specific numeric limits and current pricing tiers are maintained in Cloudflare, AWS, and Fastly documentation: Cloudflare Workers limits, Lambda at Edge restrictions, and Fastly Compute at Edge docs. All cells below use general characterizations; the linked Cloudflare, AWS, and Fastly pages carry the exact current thresholds.

DimensionCloudflare WorkersLambda at EdgeFastly Compute at Edge
Execution modelV8 isolates in shared processLambda containers at CloudFront nodesCompiled WebAssembly modules
Language supportJavaScript, TypeScript; others via WASMNode.js, Python (CloudFront subset)Any WASM-capable language; Rust and JS/AssemblyScript primary
Cold start behaviorNear-zero; isolates avoid container initStandard Lambda cold start; varies by event typeVery low overhead; WASM module load is fast
Trigger typesHTTP requests, Cron Triggers, Durable ObjectsFour CloudFront event types onlyHTTP requests via Fastly network
CDN couplingRuns on Cloudflare network; not tied to external CDNRequires active CloudFront distributionRuns on Fastly network; not tied to external CDN
Pricing modelPer request and duration; free tier includedPer request and duration; no persistent free tierUsage-based; no standalone permanent free plan
Best-fit workloadGlobal JS/TS edge logic; near-zero cold start neededTeams already on CloudFront needing event hooksRust/Go at edge; WASM language flexibility required

Use Cases: When to Choose Each Platform

Choosing the right edge platform depends on your existing cloud stack, traffic trigger model, language requirements, and how tightly you want to couple edge logic to CDN behavior. The following scenarios map common engineering contexts to the platform that fits them best. Teams managing edge deployments through IaC pipelines can apply the same decision criteria via the infrastructure-as-code tooling comparison, which covers Terraform, OpenTofu, and Pulumi deployment workflows.

Cloudflare Workers dashboard showing deployed worker scripts, request analytics, and KV storage bindings
Cloudflare Workers · Credit: Cloudflare
  1. Already operating on AWS with CloudFront as CDN: the CloudFront-coupled option is the natural fit. You gain CloudFront event hooks (viewer request, origin request, and the response variants) without adding a second edge vendor. Your existing IAM policies, CloudWatch logging, and Lambda deployment tooling all carry over. The constraint is that you are bound to CloudFront's edge location set and the four event types it exposes.
  2. Need broad global distribution with near-zero cold start and JavaScript/TypeScript: Cloudflare Workers is the most direct path. The V8 isolate execution model eliminates container init overhead, the free tier reduces experimentation cost, and Workers KV and Durable Objects cover lightweight state requirements without leaving the platform.
  3. Need WASM runtime or Rust/Go at the edge: Fastly Compute at Edge is the only option in this tier that runs compiled WebAssembly natively. Teams writing performance-sensitive edge logic in Rust, or any team whose language of choice compiles to WASM, should default here. The edge function runs with very low cold start overhead and does not require a JavaScript wrapper around native code.
  4. Operating with an IaC-first or CDN-neutral deployment workflow: Both Cloudflare Workers and Fastly Compute at Edge integrate with Terraform and Pulumi via their respective providers, making them viable for teams that manage infrastructure declaratively. AWS's edge service also supports IaC deployment via AWS CloudFormation and CDK, but only within the CloudFront dependency. The load balancing vs auto scaling at origin article is relevant context for teams deciding how much traffic handling belongs at the edge versus the origin layer.

Migration and Integration Considerations

Migrating edge logic between edge platform runtimes requires attention to trigger model differences, runtime constraints, and how each platform integrates with upstream CDN or origin infrastructure. The four areas below surface the most common friction points when porting an edge function from one platform to another.

Trigger model portability
Lambda at Edge functions respond to four specific CloudFront event types. Porting that logic to Cloudflare Workers or Fastly Compute at Edge requires rethinking trigger boundaries, since those platforms use a single HTTP request handler model rather than discrete viewer/origin event hooks. Request routing logic encoded as CloudFront behaviors must be reimplemented as conditional code in the edge function itself.
State and storage dependencies
Cloudflare Workers integrates with Workers KV and Durable Objects for persistent state. Fastly provides edge data storage options documented on the Fastly platform. Lambda at Edge has no built-in persistent edge storage; state-dependent logic typically reads from DynamoDB or S3 at origin on each invocation. Migrating stateful Workers logic to the AWS service requires either accepting origin round trips or redesigning the state model.
Language runtime compatibility
A JavaScript edge function written for Cloudflare Workers can typically be adapted for Fastly Compute at Edge via the WASM-based JavaScript runtime, though API surface differences (fetch, caching, Headers handling) require review. Lambda at Edge adds the constraint of running within CloudFront's supported Lambda runtime versions. Rust or Go code written for Fastly Compute at Edge has no direct equivalent on Workers or the AWS runtime without rewriting in a supported language.
Observability and logging
Each platform routes logs differently. The AWS service sends logs to CloudWatch Logs in the AWS region nearest to the edge location where the function executed, which can produce logs spread across multiple regions. Cloudflare Workers streams logs through Logpush or the Workers Tail command. Fastly Compute at Edge surfaces logs via Fastly's logging endpoints and real-time log streaming. Centralizing logs from any of these platforms into a single observability stack requires configuring the platform's log export and matching it to your existing pipeline.

References

Frequently Asked Questions

Does Cloudflare Workers run in every country, or only in certain regions?

Cloudflare Workers executes at Cloudflare network edge locations worldwide, so requests are handled close to the end user rather than in a fixed data-center region. The platform does not require you to select a deployment region; the runtime routes execution automatically. This behavior is distinct from Lambda at Edge, which is tied to AWS CloudFront and limited to a defined set of CloudFront edge locations.

Is Lambda at Edge the same as running AWS Lambda in multiple regions?

No. Lambda at Edge is a specialized extension of AWS Lambda that executes code at CloudFront edge nodes in response to CloudFront events such as viewer requests or origin responses. It is not the same as deploying a standard Lambda function to multiple AWS regions, and it carries different limits on memory, package size, and execution duration. Teams that want general-purpose serverless across regions typically use standard Lambda with CloudFront as a CDN layer, not Lambda at Edge.

Can Fastly Compute at Edge run WebAssembly modules written in languages other than JavaScript?

Yes. Fastly Compute at Edge uses a WebAssembly (WASM) runtime, which means any language that compiles to WASM can target the platform. Rust and JavaScript/AssemblyScript are the most commonly used paths, and Fastly provides official SDKs for both. Go and other WASM-capable languages are also viable, giving teams more runtime flexibility than platforms locked to a single execution environment.

Which edge platform has the most generous free tier for low-traffic projects?

Cloudflare Workers offers a free tier that includes a daily request allowance, making it the most accessible option for low-traffic projects and experimentation. Lambda at Edge is billed per request and per duration with no persistent free tier beyond AWS free-tier credits, and Fastly Compute at Edge is priced on a usage basis without a standalone permanent free plan. Check current thresholds on the Cloudflare Workers, AWS Lambda, and Fastly pricing pages before committing, as tiers change.

Share this guide

Amara Okeke

Amara Okeke covers cloud and web hosting for techshooked for the people who run sites and small infrastructure, from managed hosting and domain pricing to outages and the trade-offs between platforms. Coverage follows the full bill, including egress, support tiers and migration effort, and treats an outage as a story about root cause, recovery time and what customers were told along the way.