All Scenarios
easySAADVAArchitectureCost

Serverless REST API — Pay Per Use

A startup wants a REST API that costs $0 when idle and scales to thousands of requests/sec without ops overhead. They store JSON documents and need sub-50ms reads.

Key Constraints

Serverless — no servers to manage
Pay-per-request pricing
JSON document storage
Sub-50ms read latency

Reference Architecture (interactive 3D)

🖱️ Drag to rotate · 📜 Scroll to zoom

Loading diagram...

Fully Serverless Reference

  1. 1Route 53 → CloudFront with two origins: S3 for static SPA, API Gateway for /api/*.
  2. 2Lambda function per route (better security boundaries and per-route metrics).
  3. 3DynamoDB on-demand mode = zero capacity planning, pays per request.
  4. 4Add DAX in front of DynamoDB if you need sub-5ms reads at scale.
  5. 5Use a Lambda authorizer or Cognito authorizer at API Gateway — not in Lambda code.
  6. 6CloudWatch Logs for each Lambda; X-Ray for end-to-end tracing.

Common Traps (Wrong Answers)

  • Provisioned DynamoDB capacity for unknown traffic (overpay or throttle on bursts)
  • Status-based partition key like `status='active'` (creates a hot partition)
  • Authentication in Lambda code instead of API Gateway authorizers (auth runs per cold start)
  • Connecting Lambda to RDS without RDS Proxy (connection-pool exhaustion)

Try the simulator

Build this architecture yourself in the drag-and-drop simulator.