Courseiva
Continuous Improvement for Existing SolutionsmediumMultiple ChoiceObjective-mapped

SAP-C02 Continuous Improvement for Existing Solutions Practice Question

A company uses AWS Lambda to process incoming messages from an SQS queue. The Lambda function is triggered by SQS and processes messages in batches of 10. Recently, the number of messages has increased significantly, and some messages are being processed multiple times. What should a solutions architect do to ensure exactly-once processing?

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

Change the SQS queue to a FIFO queue and enable content-based deduplication.

Exactly-once processing is achieved by using an SQS FIFO queue with content-based deduplication. FIFO queues guarantee that a message is delivered exactly once and consumers receive messages in order. Lambda supports SQS FIFO as an event source, though it has lower throughput limits. Option A (DynamoDB-based idempotency) also works but adds complexity and cost. Option B (increasing reserved concurrency) only helps with scaling but does not prevent duplicates if a message is processed but the function fails after processing. Option C (increasing visibility timeout) delays reprocessing but does not guarantee exactly-once if the function is throttled or fails.

Answer analysis

Option-by-option breakdown

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

  • Use a DynamoDB table to store unique message IDs and check for duplicates before processing.

    Why it's wrong here

    While using DynamoDB to track message IDs is a common pattern for deduplication, it doesn't guarantee exactly-once processing in this specific SQS-Lambda scenario. The Lambda function might still receive a batch, begin processing, fail after marking some messages as processed in DynamoDB but before completing the batch, and then be re-invoked for the same batch. This temptation arises because DynamoDB *is* effective for idempotent operations where you want to avoid *reprocessing* the same logical operation, but it doesn't inherently solve the SQS visibility timeout and Lambda retry mechanism leading to duplicate *invocations* of the processing logic itself.

  • Set the Lambda function's reserved concurrency to a higher value to prevent throttling.

    Why it's wrong here

    Increasing reserved concurrency prevents throttling but does not ensure exactly-once processing. If the function fails after processing a message and before deletion from the queue, the message becomes visible again and is reprocessed.

  • Increase the visibility timeout of the SQS queue to 30 minutes.

    Why it's wrong here

    Increasing visibility timeout delays the time before a message becomes visible again after a failure, but it does not prevent duplicates if the function is throttled or fails during processing.

  • Change the SQS queue to a FIFO queue and enable content-based deduplication.

    Why this is correct

    Correct. Using an SQS FIFO queue with content-based deduplication ensures that duplicate messages are not introduced and each message is processed exactly once. Lambda supports SQS FIFO as an event source.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

About these practice questions

Courseiva writes every SAP-C02 question from scratch — 1,660 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. 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 SAP-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 SAP-C02 exam.