Enrich IoT data with Lambda through Kinesis Data Firehose buffering
Accompany is building an application to collect and transmit sensor data from a factory. The application will use AWS IoT Core to send data from hundreds of devices to an Amazon S3 data lake. The company must enrich the data before loading the data into Amazon S3. The application will transmit the sensor data every 5 seconds. New sensor data must be available in Amazon S3 less than 30 minutes after the application collects the data. No other applications are processing the sensor data from AWS IoT Core. Which solution will meet these requirements MOST cost-effectively?
Community Votes
58% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
Kinesis Data Firehose buffers records for up to fifteen minutes before delivering them to S3, and its transformation capability invokes Lambda for enrichment, so the buffering that reduces S3 request cost also fits inside the thirty minute window.
A factory application sends sensor data from hundreds of devices through AWS IoT Core to an S3 data lake, transmitting every five seconds. The data must be enriched before loading, must be in S3 within thirty minutes of collection, and no other application consumes it from IoT Core.
Invoking Lambda directly from the IoT rule for every message. With data arriving every five seconds from hundreds of devices, invoking Lambda per message is far more expensive than batching, and it produces many small S3 PutObject calls rather than consolidated deliveries through Firehose.
Community Discussion (19 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
An IoT rule writes the sensor data to Kinesis Data Firehose, where the buffering interval is set to 900 seconds, so records accumulate and are delivered to S3 in batched objects at most fifteen minutes after arrival, which is comfortably inside the thirty minute requirement. Firehose invokes the Lambda function for the data transformation step, so the enrichment happens on the way to S3 with no extra service in the path. Because data is buffered and delivered in batches, the S3 request and object counts are far lower than per-message writes, and no other application is reading from IoT Core, so the basic ingest path with Firehose is sufficient.Why the Other Options Are Wrong
A: Invoking Lambda from an IoT rule action runs once per message, and with a five second interval across hundreds of devices the invocation and S3 PutObject costs dominate, which contradicts the most cost-effective requirement. C: Timestream is a time series database, not a landing zone for S3, so a Lambda function would have to read the table and then write each record to S3 individually, which is both more expensive and more complex than the Firehose path. D: Kinesis Data Streams with a consumer Lambda writing each record with the PutObject API again performs per-record S3 writes with no buffering, so it is the most expensive of the batch-capable options and provides no batching benefit over the direct IoT rule.Community Comment Notes
The community voted 57 to 41 for B over A, and the deciding factor was the 900 second buffering interval against the thirty minute requirement, which the top-voted comment confirmed explicitly. The dissenting votes for A argued on simplicity and fewer resources, but they do not account for the per-message Lambda and S3 request cost at a five second ingest interval from hundreds of devices.Official Reference
Related Analysis
Practice All SAP-C02 Questions
Access 85 questions with complete answers and detailed explanations.
View Full SAP-C02 Practice Test →