DVA-C02 Troubleshooting and Optimization Practice Question
A developer is troubleshooting an AWS Lambda function that is invoked from an Amazon S3 bucket via event notifications. The function processes images and stores metadata in Amazon DynamoDB. The developer notices that some images are being processed multiple times, resulting in duplicate entries in DynamoDB. The S3 event notification is configured to send events to the Lambda function with the 's3:ObjectCreated:*' event type. The function uses the 'uuid' library to generate a unique ID for each image upon processing. What is the most likely cause of the duplicate processing?
⚠ Common exam trap
It's easy for candidates to assume generating a unique ID inside the function solves duplication, but they miss that idempotency requires using a stable, external identifier (like the S3 object key) to detect and skip already-processed events.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
S3 event notifications are delivered at least once, and the Lambda function is not idempotent.
Amazon S3 event notifications are delivered on an 'at least once' basis, meaning the same event can be sent to Lambda multiple times. If the Lambda function is not idempotent—i.e., processing the same event multiple times produces duplicate side effects—then duplicate DynamoDB entries will occur. The use of a 'uuid' library inside the function does not help because a new UUID is generated on each invocation, so the same image gets different IDs and is stored as a separate item each time.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
S3 event notifications are delivered at least once, and the Lambda function is not idempotent.
Why this is correct
S3 event notifications operate on an "at least once" delivery model, meaning that a single S3 event, such as an object creation, might trigger the associated Lambda function multiple times. If the Lambda function's logic is not designed to be idempotent, each duplicate invocation will independently process the event and perform its side effects, leading to duplicate data entries or actions. Implementing idempotency, often by using a unique identifier from the S3 event (like the object key) as a check, is crucial to prevent these redundant operations.
- ✗
The Lambda function's concurrency is set too high, causing race conditions.
Why it's wrong here
While a high concurrency setting for a Lambda function can indeed increase the likelihood of race conditions, this issue is distinct from the problem of duplicate event processing. Race conditions occur when multiple concurrent executions attempt to modify shared resources simultaneously, leading to unpredictable or inconsistent states. Duplicate event processing, however, stems from the source (S3) sending the same event multiple times, causing the Lambda function to perform the same logical operation redundantly, irrespective of how many instances run concurrently.
- ✗
The DynamoDB table does not have a primary key that prevents duplicates.
Why it's wrong here
A DynamoDB table must have a primary key, and it inherently prevents items with identical primary key values from being written. However, if the Lambda function generates a new, unique identifier (e.g., a UUID) for the primary key for each invocation, then even duplicate S3 events will result in separate, unique primary keys being generated and new items being inserted. The problem isn't the absence of a primary key, but rather the lack of a robust idempotency strategy that uses a consistent, event-derived identifier to prevent duplicate writes for the same logical operation.
- ✗
The S3 bucket is configured with versioning, causing multiple object creation events.
Why it's wrong here
S3 versioning tracks multiple versions of an object and can generate events for actions like creating new versions or deleting objects. While versioning might lead to multiple distinct events for different object states (e.g., s3:ObjectCreated:Put for a new version, then another for an update), it does not inherently cause the same event notification to be delivered multiple times. The fundamental cause of duplicate processing for a single logical S3 action is the "at least once" delivery guarantee of S3 event notifications, which applies regardless of whether versioning is enabled.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
Go deeper
Related to this question
About these practice questions
One of 724 original DVA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.