Serverless Architecture Patterns

Common patterns for designing serverless applications.

  • JSON4,443 B
  • YAML3,295 B · −26%
  • TOON2,782 B · −37%

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 it when

  • You are sketching an architecture on a serverless platform and want named patterns.
  • You need an example product for each pattern.

Watch out for

  • 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.

The data

PatternDescriptionExample
Event-DrivenFunctions trigger on events from queues, streams, or webhooks.S3 upload triggers Lambda to resize image.
API Gateway + FunctionsHTTP requests routed through API Gateway to serverless functions.AWS API Gateway + Lambda for REST APIs.
CQRSSeparate 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 FunctionsOrchestrate multiple serverless functions into workflows.Process order through validation, payment, fulfillment steps.
Static Content + FunctionsStatic assets served from CDN; dynamic logic in functions.S3 + CloudFront + Lambda@Edge.
Fan-Out / Fan-InOne event triggers many parallel function invocations whose results are later aggregated.SNS or EventBridge fan-out, Step Functions parallel state
Queue-Based Load LevelingA queue buffers bursts so functions process work at a steady, controlled rate.SQS with Lambda, Pub/Sub with Cloud Functions
Scheduled JobA timer triggers a function for periodic tasks such as cleanup and reports.EventBridge Scheduler, Cloud Scheduler, Azure Timer trigger
Webhook HandlerA function exposed at a URL receives callbacks from external services and acknowledges quickly.Functions behind an API gateway or function URL

Fields

The shape of this dataset, read from the data itself: every column, its type and a real value. Agents can use this to plan a query without fetching the whole document.

SectionFieldTypeExample
datapatternstringEvent-Driven
datadescriptionstringFunctions trigger on events from queues, stream…
dataexamplestringS3 upload triggers Lambda to resize image.

Fetch the same bytes

The static files contain the same reference rows as the API, with no API rate limit. Live metadata, such as view counts, may differ. Use the API for content negotiation; use the static files for a cacheable snapshot.

curl "https://yjtoon.com/api/dataset/serverless-patterns?format=toon"
const res = await fetch(
  "https://yjtoon.com/static-data/dataset/serverless-patterns.toon"
);
const toon = await res.text();

Rate limit: 120 requests per minute per IP, no key and no signup. API reference →

Topics

  • cloud
  • serverless
  • lambda
  • functions
  • architecture

Search the library

Search by a topic, title, or keyword.

Start with a collection

Browse all 205 datasets