Serverless Architecture Patterns

Common patterns for designing serverless applications.

The data

0

Pattern
Event-Driven
Description
Functions trigger on events from queues, streams, or webhooks.
Example
S3 upload triggers Lambda to resize image.

1

Pattern
API Gateway + Functions
Description
HTTP requests routed through API Gateway to serverless functions.
Example
AWS API Gateway + Lambda for REST APIs.

2

Pattern
CQRS
Description
Separate read and write paths into distinct functions and data stores.
Example
Write to DynamoDB, read from Elasticsearch.

3

Pattern
Backend-for-Frontend (BFF)
Description
Dedicated API layer per client type (web, mobile).
Example
Separate Lambda functions for web and mobile clients.

4

Pattern
Step Functions / Durable Functions
Description
Orchestrate multiple serverless functions into workflows.
Example
Process order through validation, payment, fulfillment steps.

5

Pattern
Static Content + Functions
Description
Static assets served from CDN; dynamic logic in functions.
Example
S3 + CloudFront + Lambda@Edge.

Fetch the same bytes

The static files are identical to what the API returns, but with no rate limit and no server round trip. Use the API when you want a query and a content type; use the files when you want to cache one document.

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