You are designing a REST API with API Gateway + Lambda + DynamoDB. For a write path, multiple items share a partition key, and clients expect “exactly-once effect” semantics even when network timeouts occur. Which approach is most appropriate?

Answer

Use DynamoDB conditional writes with a request-id attribute and a TTL for de-duplication; return the stored result on retries

Explanation

Conditional writes let you guarantee a single logical effect per request id. A TTL prevents unbounded growth while ensuring safe retry behavior.

Last reviewed: October 2026

Reviewed by FirstInTest Editorial Team

Report an error

Related questions

You are building an event-driven system with EventBridge rules that route domain events to different Lambda targets. Some events must be delivered to multiple services, while others must not be duplicated across replays. Which configuration strategy best satisfies both requirements?

View question →

A team wants to implement secure access to an AWS App Runner service via JWT-based authorization from a custom domain. They need to validate tokens and pass identity to the backend without embedding secrets in the container. Which approach is best?

View question →

You must implement secure user-specific access to objects in S3 from a web app. The app calls a backend service that issues signed URLs. Which design is most secure and scalable?

View question →

A microservice receives HTTP requests through an ALB to ECS tasks. The service must support blue/green deployments while keeping sessions consistent. Which combination is most suitable for minimizing disruption and maintaining user experience?

View question →

A Node.js Lambda function processes SQS messages. You need to ensure that when a message fails processing, it is retried with increasing delay, but also that it doesn’t loop forever on unrecoverable errors. Which option best matches this requirement?

View question →

A backend uses Step Functions to orchestrate a workflow involving retries and compensation. A task fails with an error that is known to be recoverable, but after repeated attempts you must move the workflow to a compensation step instead of failing the whole execution. Which state-machine pattern is correct?

View question →

QuestionBack to list