DEA-C01 Question 39
Single answerYou are designing a data processing pipeline using Amazon Kinesis Data Streams and AWS Lambda. The pipeline processes real-time clickstream data from a website to calculate user session statistics such as session duration and page visits. Which of the following design considerations is most critical when implementing this solution?
- A
Use stateless Lambda functions to ensure scalability and fault tolerance.
- B
Use stateful Lambda functions by enabling local storage to maintain user session data.
- C
Leverage Amazon DynamoDB or an external state store to manage user session data across invocations.
- D
Configure Kinesis Data Streams with a short retention period to reduce costs.
Show answer and explanation
Correct answer: C
Explanation
In this scenario, the calculation of user session statistics requires session-specific data to be maintained across multiple Lambda invocations. AWS Lambda is inherently stateless, so an external state management solution, such as Amazon DynamoDB, is required to store and retrieve user session data. This ensures accurate calculations and supports the real-time nature of the pipeline.
- A. Incorrect.
Stateless Lambda functions are scalable and fault-tolerant, but they cannot maintain session-specific data across invocations, which is necessary for calculating user session statistics.
- B. Incorrect.
Lambda functions do not support true statefulness or local storage across invocations. State must be managed externally.
- C. Correct.
Using DynamoDB or an external state store is the correct approach to maintaining user session data across Lambda function invocations, enabling accurate session calculations.
- D. Incorrect.
Configuring Kinesis Data Streams with a short retention period can reduce costs, but it does not address the need for maintaining state across invocations to calculate session statistics.