Serverless Computing

  1. Compute: Cloudflare Workers (edge, V8 isolates, $0.30/M) + Modal (GPU serverless, real scale-to-zero) + Lambda (native AWS integration, SnapStart Java/Python).
  2. Orchestration: Temporal (durable execution, replay, versioning) for business workflows; LangGraph for AI agents (loops, state, human-in-the-loop).
  3. Data: DynamoDB (single-digit ms, on-demand) + Pinecone Serverless / Qdrant Cloud (vector) + Redis Cloud (semantic cache, rate limiting).
  4. Observability: Native OpenTelemetry in Workers/Lambda/Modal → Datadog / Grafana Cloud (log+trace+metric+profile correlation). Reg

    Serverless 2025: From a Trend to a Profitable AI-Driven Architecture

    In 2019 we wrote that Serverless was “one of the trendiest topics”. Six years later, however, the trend has passed. What remains is an architecture decision. That decision separates the companies that scale with healthy margins. The rest, by contrast, burn budget on idle resources and operational complexity. At BAOSS we have guided 27 clients through migrations and new serverless architectures since 2022. The patterns are clear. The problem is no longer “what is serverless”, but “how do I keep it from becoming an unpredictable bill and a nest of dependencies”.

    The real problem in 2025-2026: invisible complexity and opaque costs

    The CTOs who call us today don’t ask about Lambda vs Cloud Functions. Instead, they ask about three concrete pain points:

    1. Surprise billing: for example, a retail client saw their AWS bill grow 340% in three months. The cause: triggering massive Step Functions without provisioned concurrency or reserved instances.
    2. Fragmented observability: moreover, traces distributed across API Gateway, Lambda, DynamoDB, EventBridge and S3. Correlating a failure requires 4 different tools.
    3. Real vendor lock-in: also, migration from Firebase to Supabase + Cloudflare Workers estimated at 6 person-months. The cause: coupling to proprietary triggers and non-portable SDKs.

    The original promise —”zero ops, pay per use”— collides with the reality of workloads with embedded AI. For example: cold-start inference of 2-8 seconds on models with >7B parameters. There are also 10 GB memory limits on Lambda and 15-minute timeouts. The latter force you to fragment RAG pipelines into fragile state machines.

    How the landscape has changed since 2019: 2025 data

    Dimension2019 (Original article)2025-2026 (BAOSS reality)
    Mature FaaS providersAWS Lambda, Azure Functions, GCF+ Cloudflare Workers, Vercel Edge, Netlify Functions, Supabase Edge, Modal, Beam, RunPod for serverless GPU
    Typical cold start (Node/Python)100-500 ms50-150 ms (SnapStart, V8 isolates, pre-warmed pools)
    Cold start with a 7B LLMN/A2-8 s (requires GPU warm pool or speculative decoding)
    Memory limit3 GB (Lambda)10 GB (Lambda) / 24 GB (Modal) / 80 GB (Beam)
    Max timeout15 min (Lambda)15 min (Lambda) / 4 h (Modal) / no limit (K8s + KEDA)
    Native orchestrationStep Functions, Durable FunctionsTemporal, Hatchet, LangGraph, CrewAI (workflows as code, versionable, testable)
    Cost per 1M invocations (128 MB, 100 ms)$0.20$0.20 (Lambda) / $0.0003 (Cloudflare Workers) / $0.00001 (Supabase Edge)

    The big novelty of 2025 is, without doubt, serverless GPU. Modal, Beam, RunPod and Banana let you spin up A100/H100s by the second. As a result, a fintech client cut its inference bill by 78%. The reason: moving the nightly batch scoring from EKS (24/7 GPU) to Modal (real scale-to-zero).

    Three real BAOSS cases (anonymized, audited metrics)

    Case 1: B2B Marketplace — Migration from a Spring monolith to an event-driven serverless architecture

    Context: 12 coupled services and fortnightly deployments with 40 min of downtime. Plus 3 engineers dedicated to ops.

    • Solution: API Gateway + Lambda (TypeScript) + EventBridge + DynamoDB + Step Functions for distributed sagas. The migration followed the strangler fig pattern over 6 sprints.
    • Post-migration metrics (6 months):
    • First, deployments: daily, zero downtime (canary + feature flags on LaunchDarkly)
    • Also, mean time to recovery (MTTR): 12 min → 3 min (unified traces in Datadog + X-Ray)
    • Also, infra cost/month: $18.4K → $6.2K (-66%, eliminating idle EC2/RDS)
    • Finally, engineering time on ops: 3 FTE → 0.5 FTE (reassigned to product)

    Key lesson: Step Functions Express + map state for parallel processing of 50K items/day cut P99 latency. Specifically, from 45 to 8 s down to 1.2 s. But, in addition, account limits (quotas) require proactive quota increase requests. In fact, we lost 3 days in production to a ThrottlingException on EventBridge.

    Case 2: HealthTech — Serverless RAG pipeline for a clinical assistant with GPT-4o and Claude 4

    Context: 2.4M medical documents (PDF, HL7, DICOM metadata). The need: response < 3 s, HIPAA compliance and, on top of that, predictable cost.

    • Architecture: first, S3 (landing) → Lambda (parser + semantic chunking with LangChain + Unstructured.io) → Embeddings (text-embedding-3-large via Bedrock) → Pinecone Serverless. Finally, API Gateway + Lambda runs the RAG: retrieval + rerank (Cohere Rerank 3.5) and generation (GPT-4o/Claude 4 Sonnet). All of it with NeMo guardrails.
    • Orchestration: LangGraph (stateful, reflection loops, human-in-the-loop for clinical validation). We deployed it on Modal (GPU A10G warm pool, 3 instances).
    • Results (3 months in production):
    • First, P50 latency: 1.8 s (Redis semantic cache + speculative decoding on Modal)
    • Also, cost per query: $0.018 (vs $0.067 on dedicated 24/7 EKS GPU)
    • Also, availability: 99.97% (99.9% SLA)
    • Finally, ROI: 3.2x in 6 months (ops savings + 40% reduction in medical diagnosis time)

    Trap avoided: Pinecone Serverless charges per read/write unit + storage. A poorly partitioned index (high-cardinality metadata) drove cost up 3x. Therefore, the solution was a namespace per specialty + metadata filtering pre-retrieval.

    Case 3: Last-mile logistics — Edge computing on Cloudflare Workers for real-time tracking

    Context: 15K couriers and 2M GPS events/day. Plus, latency < 100 ms P99 across 12 LATAM countries.

    • Solution: Cloudflare Workers + Durable Objects (state per courier) + Workers KV (geofencing) + Queues (peak buffering). In addition, the snapping-to-route logic + ML ETA (2 MB ONNX model compiled to WASM with wasmEdge) runs 100% at the edge.
    • Metrics:
    • First, P99 latency: 67 ms (vs 340 ms in the us-east-1 region)
    • Next, cost: $0.15/M req (includes Durable Objects) vs $2.10/M on Lambda@Edge
    • Also, deployments: 15/day (GitHub Actions + Wrangler, automatic preview deployments)
    • Finally: zero scaling incidents on Black Friday 2024 (peak of 45K req/s)

    When NOT to use serverless in 2025 (and what to choose instead)

    ScenarioWhy serverless failsBAOSS alternative
    Sustained loads > 70% capacity 24/7Unit cost 3-5x vs reserved/spotEKS/GKE + KEDA + Karpenter (spot + scale-to-zero pods)
    Deterministic ultra-low latency (< 10 ms P99)Cold starts + multi-tenant network variabilityBare metal / dedicated hosts / Cloudflare Workers (V8 isolates)
    Heavy state / massive persistent connectionsMemory/time limits, costly serializationWebSockets on K8s (Socket.io + Redis Cluster) or AppSync
    ML training / fine-tuningTimeouts, no native checkpointing, expensive GPUModal / Beam / RunPod / SageMaker Training Compiler
    Team without DevOps / observability cultureUnmanageable distributed debuggingManaged PaaS (Vercel, Railway, Render) + internal platform engineering

    The BAOSS-recommended serverless stack for 2025

    1. Compute: first, Cloudflare Workers (edge, V8 isolates, $0.30/M). Then, Modal (GPU serverless, real scale-to-zero). Finally, Lambda: native AWS integration and SnapStart Java/Python.
    2. Orchestration: Temporal (durable execution, replay, versioning) for business workflows. Then, LangGraph for AI agents (loops, state, human-in-the-loop).
    3. Data: DynamoDB (single-digit ms, on-demand) + Pinecone Serverless / Qdrant Cloud (vector). Plus, Redis Cloud (semantic cache and rate limiting).
    4. Observability: Native OpenTelemetry in Workers/Lambda/Modal → Datadog / Grafana Cloud (log+trace+metric+profile correlation). Reg

      Prefer to talk to us directly? Contact the BAOSS team and tell us about your challenge.

      Related articles: Serverless Computing / 10 Reasons to Deploy Hadoop in the Cloud.