api: YAML JSON TOON Database version: 1.0.0 format: json dataset: slug: serverless-patterns title: Serverless Architecture Patterns description: Common patterns for designing serverless applications. summary: "Architecture patterns used with serverless platforms: event-driven flows, API gateway plus functions, CQRS, backend-for-frontend, workflow orchestration and static content with functions. Extra rows add fan-out, queue-based load leveling, scheduled jobs and webhook handlers." use_when[2]: You are sketching an architecture on a serverless platform and want named patterns.,You need an example product for each pattern. caveats[2]: Patterns trade operational simplicity for platform dependence and for limits on duration and state.,Event ordering and duplicate delivery must be handled explicitly in most of these designs. related[3]: serverless-computing,architectural-design-patterns,cloud-service-models category: Cloud Computing category_slug: cloud-computing tags: "cloud,serverless,lambda,functions,architecture" view_count: 0 entry_count: 10 fields[3]{section,field,type,example}: data,pattern,string,Event-Driven data,description,string,"Functions trigger on events from queues, stream…" data,example,string,S3 upload triggers Lambda to resize image. data[10]{pattern,description,example}: Event-Driven,"Functions trigger on events from queues, streams, or webhooks.",S3 upload triggers Lambda to resize image. API Gateway + Functions,HTTP requests routed through API Gateway to serverless functions.,AWS API Gateway + Lambda for REST APIs. CQRS,Separate read and write paths into distinct functions and data stores.,"Write to DynamoDB, read from Elasticsearch." Backend-for-Frontend (BFF),"Dedicated API layer per client type (web, mobile).",Separate Lambda functions for web and mobile clients. Step Functions / Durable Functions,Orchestrate multiple serverless functions into workflows.,"Process order through validation, payment, fulfillment steps." Static Content + Functions,Static assets served from CDN; dynamic logic in functions.,S3 + CloudFront + Lambda@Edge. Fan-Out / Fan-In,One event triggers many parallel function invocations whose results are later aggregated.,"SNS or EventBridge fan-out, Step Functions parallel state" Queue-Based Load Leveling,"A queue buffers bursts so functions process work at a steady, controlled rate.","SQS with Lambda, Pub/Sub with Cloud Functions" Scheduled Job,A timer triggers a function for periodic tasks such as cleanup and reports.,"EventBridge Scheduler, Cloud Scheduler, Azure Timer trigger" Webhook Handler,A function exposed at a URL receives callbacks from external services and acknowledges quickly.,Functions behind an API gateway or function URL