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

  1. Use a scoped execution role for the function’s data access.
  2. 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.

  1. Trace the first request from the gateway to the order write.
  2. Choose an idempotency key and a durable place to record its outcome.
  3. Define how a repeated request returns the existing result.

Check your understanding

Where should durable order state live?

Continue with AWS documentation

Before following a deployment guide, review current pricing, permissions, and cleanup steps. Budget alerts are not a hard spending cap.

Saved in this browser. Press again to undo.

Prepaid · USD

Top up balance

Available balance: $0.00

Your balance works across Heap tools. A failed lookup or generation releases its reserved amount.