Courseiva
Development with AWS ServicesmediumMultiple ChoiceObjective-mapped

DVA-C02 Development with AWS Services Practice Question

A developer is building a serverless application that processes user-submitted images. The images are uploaded to an S3 bucket, which triggers an AWS Lambda function that creates a thumbnail and stores it in another S3 bucket. The developer notices that sometimes the Lambda function is invoked multiple times for a single image upload. What should the developer configure to ensure idempotent processing?

⚠ Common exam trap

Candidates often assume SQS or filters guarantee exactly-once delivery, but AWS services like S3 and SQS both use at-least-once semantics, so idempotency must be implemented at the consumer level.

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

Implement a DynamoDB table to track processed objects.

S3 event notifications can occasionally deliver duplicate events (at-least-once semantics). By storing the unique object key (or ETag) in a DynamoDB table with a TTL, the Lambda function can check if the object has already been processed and skip duplicate invocations, ensuring idempotent processing.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Enable S3 event notifications with a suffix filter.

    Why it's wrong here

    Enabling S3 event notifications with a suffix filter only refines which objects trigger notifications based on their filename extension (e.g., '.jpg' or '.csv'). It does not provide any mechanism to deduplicate events for the *same* object if S3 or the downstream service (like Lambda) experiences retries or multiple deliveries due to the distributed nature of the system. Therefore, duplicate processing for a single object remains a possibility, as S3 event notifications inherently offer "at-least-once" delivery.

  • Use an SQS queue to decouple S3 events.

    Why it's wrong here

    While an SQS queue can buffer events, it does not guarantee deduplication. Standard queues still deliver at-least-once, and FIFO queues would require a deduplication ID but still may deliver duplicates if the ID is the same.

  • Implement a DynamoDB table to track processed objects.

    Why this is correct

    Implementing a DynamoDB table to store identifiers of successfully processed objects (e.g., S3 object key and version ID) is an effective strategy for achieving idempotency. Before processing an S3 event, the Lambda function can attempt to write the object's unique identifier to the DynamoDB table with a `ConditionExpression` that ensures the item does not already exist. If the write fails because the item is already present, it indicates a duplicate event, and the function can safely exit without reprocessing, thus preventing unintended side effects.

  • Increase the Lambda function's timeout.

    Why it's wrong here

    Increasing a Lambda function's timeout only extends the maximum duration the function is allowed to run before being terminated. It does not influence the frequency or number of times the function is invoked by an upstream event source like S3. If S3 sends duplicate event notifications, or if the Lambda service retries an invocation, increasing the timeout will not prevent these duplicate invocations from occurring; it merely allows each invocation, whether original or duplicate, to run longer.

Quick reference

AWS S3 Storage Class Comparison

Storage ClassMin DurationRetrievalUse Case
S3 StandardNoneImmediateFrequently accessed data
S3 Standard-IA30 daysImmediateInfrequent access, rapid retrieval
S3 One Zone-IA30 daysImmediateNon-critical infrequent data
S3 Intelligent-TieringNoneImmediate–hoursUnknown or changing access patterns
S3 Glacier Instant90 daysMillisecondsArchive with instant retrieval
S3 Glacier Flexible90 daysMinutes–hoursArchive, flexible retrieval
S3 Glacier Deep Archive180 daysHoursLong-term compliance archive

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 →

How Courseiva writes practice questions · Editorial policy

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.