An application deployed on IoT devices sends data to a RESTful API implemented by an AWS Lambda function. Each request includes a unique identifier. Traffic can spike unpredictably, and when requests are throttled the client may retry, causing duplicate requests. The API must handle duplicates without inconsistency or data loss. Which solution meets these requirements?
Choose an answer
Tap an option to check your answer.
Correct answer: Use an Amazon DynamoDB table to record each request's unique identifier. Modify the Lambda function to check the table for the identifier before processing..
Why this is the answer
The correct solution leverages Amazon DynamoDB for its strong consistency and high availability, making it ideal for storing and checking unique identifiers to prevent duplicate processing. Before processing a request, the Lambda function can perform a conditional write or a GetItem operation on the DynamoDB table to check if the identifier already exists. If it does, the request is a duplicate and can be safely ignored or an appropriate response returned. This ensures idempotency and prevents data inconsistency or loss. Using Amazon RDS for MySQL would introduce higher latency and operational overhead compared to DynamoDB for this specific use case. Returning a client error for duplicates doesn't prevent the initial processing of the duplicate request, which could still lead to inconsistencies. Amazon ElastiCache for Memcached is an in-memory cache and does not guarantee data persistence or strong consistency, making it unsuitable for reliably tracking unique identifiers across retries.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed