api: YAML JSON TOON Database
version: 1.0.0
format: yaml
dataset:
  id: 2890
  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:
    - You are sketching an architecture on a serverless platform and want named patterns.
    - You need an example product for each pattern.
  caveats:
    - 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:
    - serverless-computing
    - architectural-design-patterns
    - cloud-service-models
  entry_count: 10
  fields:
    - section: data
      field: pattern
      type: string
      example: Event-Driven
    - section: data
      field: description
      type: string
      example: Functions trigger on events from queues, stream…
    - section: data
      field: example
      type: string
      example: S3 upload triggers Lambda to resize image.
  category: Cloud Computing
  category_slug: cloud-computing
  tags: cloud,serverless,lambda,functions,architecture
  view_count: 26
  created_at: 1793403093
  updated_at: 1793403093
data:
  - pattern: Event-Driven
    description: Functions trigger on events from queues, streams, or webhooks.
    example: S3 upload triggers Lambda to resize image.
  - pattern: API Gateway + Functions
    description: HTTP requests routed through API Gateway to serverless functions.
    example: AWS API Gateway + Lambda for REST APIs.
  - pattern: CQRS
    description: Separate read and write paths into distinct functions and data stores.
    example: Write to DynamoDB, read from Elasticsearch.
  - pattern: Backend-for-Frontend (BFF)
    description: Dedicated API layer per client type (web, mobile).
    example: Separate Lambda functions for web and mobile clients.
  - pattern: Step Functions / Durable Functions
    description: Orchestrate multiple serverless functions into workflows.
    example: Process order through validation, payment, fulfillment steps.
  - pattern: Static Content + Functions
    description: Static assets served from CDN; dynamic logic in functions.
    example: S3 + CloudFront + Lambda@Edge.
  - pattern: Fan-Out / Fan-In
    description: One event triggers many parallel function invocations whose results are later aggregated.
    example: SNS or EventBridge fan-out, Step Functions parallel state
  - pattern: Queue-Based Load Leveling
    description: A queue buffers bursts so functions process work at a steady, controlled rate.
    example: SQS with Lambda, Pub/Sub with Cloud Functions
  - pattern: Scheduled Job
    description: A timer triggers a function for periodic tasks such as cleanup and reports.
    example: EventBridge Scheduler, Cloud Scheduler, Azure Timer trigger
  - pattern: Webhook Handler
    description: A function exposed at a URL receives callbacks from external services and acknowledges quickly.
    example: Functions behind an API gateway or function URL
