
Answer-first summary for fast verification
Answer: Use AWS Lambda with a Python script
## Explanation **Why AWS Lambda is the most cost-effective solution:** 1. **Small data size**: Each mattress generates only 2 MB of data per night, which is a very small amount of data. 2. **Short execution time**: Processing finishes within 30 seconds, which is well within Lambda's 15-minute maximum execution time. 3. **Memory requirement**: 1 GB of memory is easily supported by Lambda (up to 10 GB). 4. **Event-driven processing**: Lambda can be triggered automatically when new data arrives in S3. 5. **Cost efficiency**: - Lambda charges per millisecond of execution time and memory used - With 2 MB data and 30-second processing time, the cost would be extremely low - No need to pay for idle resources (serverless) - No cluster management overhead **Why other options are less cost-effective:** - **AWS Glue (A & D)**: Glue is designed for ETL jobs on larger datasets and has a minimum billing duration of 1 minute plus DPU costs. For small, frequent jobs, Lambda is more cost-effective. - **Amazon EMR (B)**: EMR is for big data processing on large clusters and has significant overhead for cluster setup/teardown. It's overkill for 2 MB of data. **Key considerations:** - Lambda's pay-per-use model is ideal for small, frequent processing tasks - S3 event notifications can trigger Lambda automatically - Python script in Lambda can easily process and summarize the data - Results can be written back to S3 or stored in a database for immediate availability This solution provides the fastest processing with minimal cost, meeting the requirement for results to be "available as soon as possible" while being the most cost-effective option.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
An IoT company is releasing a mattress that has sensors to collect data about a user's sleep. The sensors will send data to an Amazon S3 bucket. The sensors collect approximately 2 MB of data every night for each mattress. The company must process and summarize the data for each mattress. The results need to be available as soon as possible. Data processing will require 1 GB of memory and will finish within 30 seconds.
Which solution will meet these requirements MOST cost-effectively?
A
Use AWS Glue with a Scala job
B
Use Amazon EMR with an Apache Spark script
C
Use AWS Lambda with a Python script
D
Use AWS Glue with a PySpark job