Serverless Architecture Patterns
Common patterns for designing serverless applications.
Common patterns for designing serverless applications.
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.
| 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 |
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.
| 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. |
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 →