A Lambda function calls DynamoDB on every invocation. Connection setup dominates latency. Invocations may reuse an execution environment. Which implementation reduces repeated setup while avoiding shared user state?

Published
  1. Cache every response forever in the deployment package directory.
  2. Initialize the SDK client outside the handler and keep request-specific data within the invocation.
  3. Create a new SDK client for every record and store customer payloads in globals.
  4. Assume the same environment will process all future requests and omit recovery code.

Comments — 0