Q59 — AWS DOP-C02 Ch.2
Question 59 of 100 | ← Chapter 2
A DevOps engineer manages a web application running on Amazon EC2. The application uses Amazon Kinesis Data Streams to ingest and process web logs. The DevOps engineer also manages a Kinesis consumer application running on Amazon EC2. A sudden spike in data volume causes the Kinesis consumer application to fall behind, and Kinesis data is discarded before records can be processed. The DevOps engineer must implement a solution to improve processing throughput. Which solution meets these requirements with the highest operational efficiency?
- A. Modify the Kinesis consumer application to persist logs in Amazon S3. Use Amazon EMR to process data directly on Amazon S3 for customer insights. Store results in Amazon S3.
- B. Horizontally scale the Kinesis consumer application by adding more EC2 instances based on the Amazon CloudWatch GetRecords.IteratorAgeMilliseconds metric. Increase the Kinesis data stream retention period. ✓
- C. Refactor the Kinesis consumer application to run as an AWS Lambda function. Configure the Kinesis data stream as an event source for the Lambda function to process the data stream.
- D. Increase the number of shards in the Kinesis data stream to increase overall throughput so the consumer application processes data faster.
Correct Answer: B. Horizontally scale the Kinesis consumer application by adding more EC2 instances based on the Amazon CloudWatch GetRecords.IteratorAgeMilliseconds metric. Increase the Kinesis data stream retention period.
Explanation
Amazon Kinesis Data Streams manages throughput through shards, each with fixed processing capacity. When consumer application processing speed is insufficient, data may be discarded due to retention limits. Horizontal scaling of EC2 instances increases consumer processing capacity. The CloudWatch GetRecords.IteratorAgeMilliseconds metric monitors consumer lag in real time, reflecting how long records remain unprocessed; high values trigger scaling actions. Extending the Kinesis data stream retention period (default 24 hours, up to 7 days) provides buffer time to process backlogged data. Option B combines dynamic scaling with retention policy adjustment, directly addressing processing lag and preventing data loss. Option D increases shards but does not resolve insufficient consumer processing speed. Option C’s Lambda function faces execution duration and concurrency limitations, making it unsuitable for high-throughput scenarios. AWS recommends monitoring consumer lag with CloudWatch and scaling consumer instances to improve processing capacity (see AWS Kinesis Developer Guide).