A Lambda function reads multiple items from DynamoDB using BatchGetItem. The function should return a consistent view for a specific request, but the application does not require full transaction semantics across multiple tables. How can you best achieve request-level consistency?

Answer

Use ConsistentRead=true in BatchGetItem to get strongly consistent reads for items in that call

Explanation

Strongly consistent reads provide a consistent view of items as of the time of the read operation. TransactGetItems is unnecessary if you only need consistent reads for items within a request.

Last reviewed: October 2026

Reviewed by FirstInTest Editorial Team

Report an error

Related questions

A Node.js Lambda updates an item in DynamoDB using UpdateExpression and expects the update to fail if the record has changed since the client last read it. The client provides a version attribute. What DynamoDB strategy best ensures correct concurrency control?

View question →

You’re designing an AWS SDK-based .NET application that uploads objects to S3. The application must support resumable uploads and should minimize unnecessary retries and connection setup. What approach best fits the requirement?

View question →

A backend service uses API Gateway (HTTP API) to invoke a Lambda function. The Lambda writes to DynamoDB and occasionally needs to read additional details from S3. To meet least-privilege and avoid hardcoding credentials, which combination of AWS features is most appropriate?

View question →

In a serverless app, developers want to standardize how Lambda functions call external services with caching to reduce latency. They also want the cache to be shared across multiple concurrent function instances. The team proposes using an in-memory cache inside the Lambda handler, and also suggests storing tokens in environment variables for convenience. They need a robust approach that works across cold starts, supports token refresh, and avoids leaking secrets into logs or deployments.

View question →

A Lambda function is behind API Gateway and receives requests with an Authorization header. You must validate JWTs and route to different DynamoDB tables based on the tenant claim. Which approach is most secure and maintainable?

View question →

You need to ensure idempotency for an order-processing Lambda triggered by SQS messages. Messages might be delivered more than once, and processing must not double-charge. Which design is most appropriate?

View question →

QuestionBack to list