The mental model
API Gateway accepts and routes HTTP requests. Lambda executes application code, and a separate data service persists business state. A function’s execution environment may be reused, but its memory and local files are not a durable application database. Keep credentials in a workload identity and validate requests at the appropriate application boundary.
Design for authentication, authorization, input size, execution duration, concurrency, and downstream limits. A burst of successful function invocations can still exhaust database connections or a third-party quota. Bound retries and timeouts, and make repeatable write operations idempotent so a client retry does not create a second order.
Decisions to make
- Use a scoped execution role for the function’s data access.
- Limit concurrency and downstream work based on the whole request path.
Design exercise · no AWS resources needed
Work through a scenario
A checkout request times out and the browser retries it.
- Trace the first request from the gateway to the order write.
- Choose an idempotency key and a durable place to record its outcome.
- Define how a repeated request returns the existing result.
Check your understanding
Where should durable order state live?
Choose an answer to see the reasoning.
Continue with AWS documentation
Before following a deployment guide, review current pricing, permissions, and cleanup steps. Budget alerts are not a hard spending cap.