Batch smart meter readings through Kinesis Data Streams and raise DynamoDB write capacity
A utility company wants to collect usage data every 5 minutes from its smart meters to facilitate time-of-use metering. When a meter sends data to AWS, the data is sent to Amazon API Gateway, processed by an AWS Lambda function. and stored in an Amazon DynamoDB table. During the pilot phase, the Lambda functions took from 3 to 5 seconds to complete. As more smart meters are deployed, the engineers notice the Lambda functions are taking from 1 to 2 minutes to complete. The functions are also increasing in duration as new types of metrics are collected from the devices. There are many ProvisionedThroughputExceededException errors while performing PUT operations on DynamoDB, and there are also many TooManyRequestsException errors from Lambda. Which combination of changes will resolve these issues? (Choose two.)
Community Votes
100% of anonymous learners picked answer AD. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
The two exception types point at two separate ceilings, so both must be addressed: DynamoDB's provisioned write throughput is the first, and Lambda concurrency is the second, and streaming the data through Kinesis to be processed in batches attacks the second by cutting the number of invocations.
A utility collects usage data every five minutes from smart meters through API Gateway and Lambda into a DynamoDB table. In the pilot the functions took three to five seconds, but they now take one to two minutes and are getting slower as new metric types are added, with ProvisionedThroughputExceededException on DynamoDB PUTs and TooManyRequestsException from Lambda.
Increasing the Lambda memory size. More memory makes the function run faster per invocation, which helps duration, but the problem is too many concurrent invocations of a fixed duration rather than each one being too slow, so raising memory reduces TooManyRequestsException only marginally and does nothing at all for the DynamoDB write throughput errors.
Community Discussion (6 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
The two error types map to two distinct limits. The ProvisionedThroughputExceededException errors on the DynamoDB PUT operations mean the table's provisioned write capacity units cannot absorb the write rate, so increasing the write capacity units directly removes that ceiling, which is why A is correct. The TooManyRequestsException errors from Lambda mean the function is being invoked faster than the configured concurrency allows, and streaming the data into an Amazon Kinesis data stream from API Gateway lets the processing happen in batches instead of one invocation per message, which cuts the invocation count and the per-invocation overhead that is driving duration up. That is why D is correct. Because batching also reduces the number of individual writes, the two changes reinforce each other.Why the Other Options Are Wrong
B: Raising the function's memory reduces the duration of each invocation, but the function is already taking one to two minutes, so it is concurrency-bound rather than CPU-bound, and more memory does not change the number of invocations required per meter reading. It also does nothing for the DynamoDB throughput errors. C: Increasing the payload size from the meters makes each invocation process more data and write more items, which worsens both the Lambda concurrency pressure and the DynamoDB write throughput pressure, so it moves the metrics in exactly the wrong direction. E: An SQS FIFO queue adds a polling model and ordered message semantics that are not required here, and it still processes one message per invocation, so it does not reduce the invocation count the way batching through Kinesis does.Community Comment Notes
The community voted 100 to 0 for A and D, and the top-voted comment explained that increasing the write capacity units and processing data in batches through Kinesis addresses the throughput limitation, reduces Lambda invocation overhead, and lowers the load on both services. A dissenting comment argued for increasing Lambda memory, but the consensus view was that Kinesis batching is what reduces the invocation count rather than making each individual invocation faster.Official Reference
Related Analysis
Practice All SAP-C02 Questions
Access 85 questions with complete answers and detailed explanations.
View Full SAP-C02 Practice Test →