Scan with Phone

Scan to instantly open and share this page on your mobile device.

Link copied to clipboard!

Group 3: Serverless Compute

Event-driven compute without server management: Lambda, Step Functions, Lambda Layers, Lambda@Edge.

Core Principle: Pay only for execution time; optimize for event-driven architectures where rapid scaling and zero-ops overhead outweigh cold start concerns.

Services & Roles

Lambda

Event-driven functions with automatic scaling & millisecond billing.
  • Event triggers
  • Auto scaling
  • Pay per invoke

Step Functions

Visual workflow orchestration for distributed applications.
  • State machines
  • Error handling
  • Visual workflows

Lambda Layers

Shared code libraries across multiple Lambda functions.
  • Code reuse
  • Version control
  • Dependency mgmt

Lambda@Edge

Run Lambda functions at CloudFront edge locations globally.
  • Edge compute
  • Low latency
  • Content transformation

Key Differences

DimensionLambdaStep FunctionsLambda LayersLambda@Edge
PrimaryFunction executionWorkflow orchestrationCode sharingEdge processing
Duration Limit15 minutes1 year (via states)N/A (library)30 seconds
ScalingAutomaticStep-basedInherits functionGlobal edge
Use CaseEvent processingComplex workflowsShared dependenciesCDN customization

Selection Model

0–10 sliders weight emphasis for serverless workload characteristics.

{{c.desc}}
Score_Lambda = 0.30*C_eventDriven + 0.24*C_autoScale + 0.18*C_costOptimal + 0.14*C_stateless + 0.08*C_quickExec + 0.06*(10 - C_longRunning) Score_StepFunc = 0.32*C_orchestration + 0.26*C_complexWorkflow + 0.16*C_errorHandling + 0.12*C_visualization + 0.08*C_stateMgmt + 0.06*(10 - C_quickExec) Score_Layers = 0.36*C_codeReuse + 0.28*C_dependencyMgmt + 0.16*C_versionControl + 0.12*C_packageSize + 0.08*(10 - C_eventDriven) Score_EdgeLambda = 0.34*C_edgeCompute + 0.26*C_lowLatency + 0.18*C_globalDistrib + 0.12*C_cdnCustom + 0.06*C_contentTransform + 0.04*(10 - C_longRunning)
Lambda {{vm.scores.lambda|number:2}}
Step Functions {{vm.scores.stepfunc|number:2}}
Lambda Layers {{vm.scores.layers|number:2}}
Lambda@Edge {{vm.scores.edge|number:2}}
Primary Emphasis: {{vm.recommended.name}} ({{vm.recommended.score|number:2}})

Heuristics

  • High C_eventDriven + C_autoScale → Lambda for reactive processing.
  • Strong C_orchestration + C_complexWorkflow → Step Functions for multi-step processes.
  • High C_codeReuse + C_dependencyMgmt → Lambda Layers for shared libraries.
  • C_edgeCompute + C_lowLatency → Lambda@Edge for CDN processing.

Anti-Patterns

  • Using Lambda for long-running processes (use ECS/Fargate instead).
  • Complex state management in Lambda (use Step Functions).
  • Duplicating dependencies across functions (use Lambda Layers).
  • Processing at origin when edge processing would reduce latency.

Summary

Choose Lambda for event-driven functions, Step Functions for workflow orchestration, Lambda Layers for code sharing, and Lambda@Edge for global edge processing with CDN integration.

Next: Container Orchestration provides managed container platforms.

next