Batch smart meter readings through Kinesis Data Streams and raise DynamoDB write capacity

Answer Correct answers: A, D — Increase DynamoDB write capacity units and stream the data through Kinesis Data Streams for batch processing.

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.)

  1. Increase the write capacity units to the DynamoDB table. Correct Answer
  2. Increase the memory available to the Lambda functions.
  3. Increase the payload size from the smart meters to send more data.
  4. Stream the data into an Amazon Kinesis data stream from API Gateway and process the data in batches. Correct Answer
  5. Collect data in an Amazon SQS FIFO queue, which triggers a Lambda function to process each message

Community Votes

AD
100%

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)

mifune 👍 6 Selected: AD
I would go with Increasing the write capacity units to the DynamoDB table and Stream the data into an Amazon Kinesis data stream from API Gateway and process the data in batches. I think that processing the data in batches is much better than increasing the lambda functions memory.
zapper1234 👍 5
AB because the more memory a Lambda funtion has the faster it reacts
0b43291 👍 1 Selected: AD
By increasing the DynamoDB write capacity units and streaming the data into a Kinesis data stream for batch processing, you can address the throughput limitations, reduce Lambda invocation overhead, and improve the overall performance and scalability of the smart meter data processing pipeline. The other options are either not applicable or may not resolve the issues effectively: B. Increasing the memory available to the Lambda functions may not resolve the issues caused by the high volume of concurrent requests and the need for batching. C. Increasing the payload size from the smart meters is not necessary and may even exacerbate the issues by increasing the processing overhead for each data point. E. Collecting data in an Amazon SQS FIFO queue and triggering a Lambda function for each message would still result in a high number of Lambda invocations and may not provide significant performance improvements compared to processing data in batches from a Kinesis data stream.
vip2 👍 4 Selected: AD
Kinesis allows to process data in batches, which can help reduce the number of requests and the load on your Lambda functions and DynamoDB.
wbedair 👍 3 Selected: AD
A and D
ujizane 👍 2
need batch execution so i think AD is correct

Comments & Corrections

No comments yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Submitted for moderation before publishing. Keep it helpful and respectful.

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 →

← Back to SAP-C02 Study Guide