DEA-C01 Question 38
Single answerA data engineering team is building a real-time stream processing application using Amazon Kinesis Data Analytics. The application needs to process incoming sensor data, where each record's processing depends on the state of previous records (e.g., maintaining a running total of sensor readings for each device). Which type of transaction is most appropriate for this application, and why?
- A
Stateless transactions, because they ensure high scalability by treating each record independently.
- B
Stateful transactions, because they allow maintaining and updating state information across multiple records.
- C
Stateless transactions, because they are faster and more efficient for managing stateful requirements.
- D
Stateful transactions, because they eliminate the need for external storage systems when managing state.
Show answer and explanation
Correct answer: B
Explanation
Stateful transactions are required when the processing of a record depends on maintaining and updating state information across multiple records, such as in this scenario where a running total of sensor readings needs to be computed for each sensor device. Stateless transactions, by design, do not maintain state across records, making them unsuitable for this use case.
- A. Incorrect.
Stateless transactions are unsuitable for this use case since they treat each record independently and cannot maintain a running total or any other state across records.
- B. Correct.
Stateful transactions are the correct choice because they allow the application to maintain and update state information across multiple records, which is necessary for computing a running total of sensor readings.
- C. Incorrect.
Stateless transactions do not inherently support stateful requirements, so this option is incorrect.
- D. Incorrect.
While stateful transactions do manage state internally, external storage systems may still be necessary for fault tolerance or scalability, making this statement overly simplistic and not entirely accurate.