Recommendation

从现有 Web 平台的函数能力开始;跨边缘与平台组件需求强时评估 Cloudflare。

确认执行时长、状态、区域和网络需求;长连接与重任务往往不适合函数。12

适用范围: Teams deploying bounded APIs, request handlers, event consumers, or stateless services without managing servers

Main trade-off

按需执行降低运维门槛,却增加运行时限制、观测和本地复现难度。12

选择标准

按真实约束逐项判断,不要只比较功能列表。

  1. Runtime compatibility

    Verify language version, libraries, native dependencies, APIs, packaging, startup, and container requirements.12

  2. Execution envelope

    Model duration, CPU, memory, concurrency, cold starts, request limits, and cancellation behavior.12

  3. State and networking

    Define external state, connections, private networking, egress, event sources, and regional requirements.34

  4. Platform ownership

    Account for IAM, observability, retries, deployment, quotas, adjacent services, and migration cost.12

适用路线

这些条件会改变默认答案;请在作出承诺前逐项验证。

Web APIs and Cloudflare bindings fit

Evaluate Cloudflare Workers.

The isolate model supports distributed request and event execution with a low server-operations surface.

Verify: Unsupported Node.js behavior, persistent processes, arbitrary containers, or incompatible limits should move the route.12

AWS events and IAM define the system

Evaluate AWS Lambda Functions.

AWS event sources and service integrations can make the function boundary operationally coherent.

Verify: Persistent servers, incompatible duration or quota behavior, or unmodeled adjacent AWS costs should move the route.1234

A container contract is required without Kubernetes

Evaluate Google Cloud Run.

Managed request-driven services preserve broad container compatibility while avoiding cluster operations.

Verify: Kubernetes APIs, daemon behavior, or direct node and scheduler control require another container route.125

边界: This Task does not choose serverless databases, long-lived background workflows, schedulers, message brokers, or Kubernetes orchestration.

关键差异

把真正会改变决策的边界单独比较。

Runtime
Isolate APIs, function runtimes, and containers accept different dependencies and server assumptions.12
Scaling unit
Requests, function invocations, and container instances create different concurrency and cold-start behavior.5
Integration
Bindings, event sources, IAM, networking, and service graphs create provider-specific architectures.34
Billing
Invocation, duration, CPU, memory, instance, networking, and adjacent-service charges must be modeled.12

官方资源

官方文档与继续决策的正式路径。

来源

支撑页面关键主张的资料。

  1. 1
    Cloudflare Workers documentation

    Cloudflare · Accessed Official

  2. 2
    Cloudflare Workers limits

    Cloudflare · Accessed Official

  3. 3
    AWS Lambda developer guide

    Amazon Web Services · Accessed Official

  4. 4
    AWS Lambda quotas

    Amazon Web Services · Accessed Official

  5. 5
    Google Cloud Run overview

    Google Cloud · Accessed Official