DVA-C02 Development with AWS Services Practice Question
A developer is writing a Lambda function that processes records from a Kinesis stream. The function must handle duplicate records and ensure exactly-once processing. Which approach should the developer use?
⚠ Common exam trap
It's easy for candidates to confuse ordering with deduplication, assuming that enabling record ordering (Option B) prevents duplicates, when in fact ordering only ensures records are processed in sequence, not that each record is processed only once.
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
✓
Use a unique identifier for each record and store processed IDs in a DynamoDB table to skip duplicates.
Exactly-once processing in a Kinesis-triggered Lambda function requires idempotency. By using a unique identifier (e.g., Kinesis sequence number or a business key) and storing processed IDs in a DynamoDB table, the function can check for duplicates before processing each record. This pattern ensures that even if Kinesis delivers the same record multiple times (due to retries or shard rebalancing), the record is only processed once.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Disable retries in the Lambda function to avoid processing duplicates.
Why it's wrong here
Disabling retries for a Lambda function processing Kinesis records is detrimental because it sacrifices crucial fault tolerance. If a processing error occurs due to transient issues, the record will be lost and not reprocessed, leading to data loss rather than preventing duplicates. While retries can contribute to duplicate processing, disabling them entirely is an an inappropriate solution that introduces a more severe problem of data integrity and reliability.
- ✗
Enable record ordering in the Kinesis stream.
Why it's wrong here
Enabling record ordering in an Amazon Kinesis stream ensures that records within a single shard are delivered to consumers in the exact order they were written. However, this feature does not inherently prevent duplicate processing by the Lambda function. Duplicates typically arise from the "at-least-once" delivery semantics of Kinesis to Lambda, or from the upstream producer sending the same data multiple times, which ordering cannot mitigate.
- ✓
Use a unique identifier for each record and store processed IDs in a DynamoDB table to skip duplicates.
Why this is correct
This is the most effective and recommended approach for ensuring idempotent processing of Kinesis records by a Lambda function. By assigning a unique identifier (e.g., a UUID or a combination of source ID and timestamp) to each record and storing these IDs in a DynamoDB table upon successful processing, the Lambda function can check if a record has already been processed before executing its core logic. This prevents duplicate processing even with Kinesis's "at-least-once" delivery semantics and Lambda retries, ensuring data consistency.
- ✗
Send the records to an SQS FIFO queue for deduplication.
Why it's wrong here
Amazon Kinesis Data Streams cannot directly send records to an Amazon SQS FIFO queue; an intermediary service like another Lambda function or Kinesis Firehose would be required to bridge this gap. This introduces significant architectural complexity, additional latency, and increased operational overhead. Furthermore, while SQS FIFO queues offer deduplication, it applies to messages *sent to the queue*, not to records already being processed from Kinesis, making it an unsuitable solution for deduplicating Kinesis stream events.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
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.