DVA-C02 Development with AWS Services Practice Question
A developer is designing a system where an S3 bucket receives uploads, and each upload triggers a Lambda function to process the file. The processed output is stored in another S3 bucket. The developer notices that sometimes the same file is processed multiple times. How can this be prevented?
⚠ Common exam trap
While Amazon S3 Event Notifications do support SQS FIFO queues as destinations, relying solely on SQS FIFO deduplication is insufficient. SQS FIFO deduplication has a strict 5-minute window and does not protect against Lambda retries, function timeouts, or duplicate uploads occurring outside that window. True end-to-end idempotency must be implemented at the application level (e.g., using DynamoDB).
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
✓
Make the Lambda function idempotent by checking if the object has already been processed using a DynamoDB table.
Making the Lambda function idempotent using a DynamoDB table ensures that even if the same S3 event is delivered multiple times (due to at-least-once delivery semantics) or if the same file is uploaded again, the function checks a unique identifier (such as the object key or hash) in DynamoDB before processing. If it has already been processed, the function can safely skip it. This is the standard architectural pattern for ensuring idempotency in serverless pipelines.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Make the Lambda function idempotent by checking if the object has already been processed using a DynamoDB table.
Why this is correct
To ensure reliable processing despite S3's "at-least-once" event delivery model, a Lambda function must be idempotent. This is achieved by using a persistent store, such as a DynamoDB table, to record unique identifiers of processed S3 objects. Before processing an S3 event, the Lambda function checks if the object's unique identifier (e.g., bucket name + object key + version ID) already exists in the DynamoDB table. If it does, the function skips processing, preventing duplicate work and maintaining data consistency.
- ✗
Use an SQS FIFO queue as the event destination and enable content-based deduplication.
Why it's wrong here
S3 event notifications have specific supported destinations, which include SQS Standard queues, SNS topics, and AWS Lambda functions. SQS FIFO (First-In, First-Out) queues are not a directly supported target for S3 event notifications. Therefore, attempting to configure S3 to send events directly to an SQS FIFO queue, even with its built-in deduplication features, is not a viable architectural option within AWS.
- ✗
Enable S3 bucket replication to another bucket and trigger Lambda from the replica.
Why it's wrong here
S3 bucket replication, whether Cross-Region Replication (CRR) or Same-Region Replication (SRR), is designed to create copies of objects in a destination bucket for purposes like disaster recovery, compliance, or data locality. While replication creates new objects, it does not inherently provide a mechanism to deduplicate event notifications originating from the source S3 bucket's event system. If the original S3 event notification system sends duplicate events, triggering Lambda from a replica bucket will not resolve the underlying issue of potential duplicate processing.
- ✗
Enable S3 bucket versioning and use 's3:ObjectCreated:Put' events.
Why it's wrong here
S3 bucket versioning is a feature that preserves multiple variants of an object in the same bucket, protecting against accidental overwrites or deletions by keeping a complete history. While 's3:ObjectCreated:Put' is a valid event type, enabling versioning itself does not alter S3's event notification delivery guarantees. S3 operates on an "at-least-once" delivery model for events, meaning duplicate notifications can still be sent for a single object creation, regardless of whether versioning is enabled or not.
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 1,135 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.