A Lambda function reads records from a Kinesis stream and must clean and enrich each one before it reaches a feature store in near real time. What is this pattern?
- Exam domain
- Data Preparation for ML and AI28% of the exam
- Difficulty
- Easy
- In this mock
- 24 questions on this domainPractise this domain
Why the exam asks this
Task 1.2: Perform data transformation, feature engineering, and pre-processing.
Objective in the exam guide: Skill 1.2.3: Transform streaming data (for example, by using AWS Lambda, Spark).
Real-time models need features computed from streams within seconds. Knowing the simple serverless pattern is the starting point.
Why A is the answer
Streaming data transformation with Lambda as the stream consumer
Lambda can consume Kinesis records and transform them in near real time.
Remember: Near real-time cleaning of stream records: Lambda consuming Kinesis.
How it works
AWS Lambda can be triggered by a Kinesis data stream, receiving records in batches.
The function cleans, enriches or reshapes each record and writes the result onward, for example to a feature store.
For heavier stateful processing, Spark streaming or Apache Flink are options.
Clues in the question
The words that point to the answer, and what each one tells you.
- Reads records from a Kinesis stream
- A stream consumer.
- Near real time
- Not batch.
In detail
- Lambda polls the stream and processes records in batches.
- Spark streaming is an alternative for heavier transformations.
Side by side with look-alikes
| Pattern | Latency |
|---|---|
| Lambda consuming Kinesis | Seconds |
| Spark streaming | Seconds |
| Batch transform | Minutes to hours |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Streaming data transformation with Lambda as the stream consumerRight
Near real-time cleaning of stream records: Lambda consuming Kinesis.
B. Batch transform with SageMaker AIWrongMost tempting
Batch transform is offline inference, not stream processing.
Why it tempts: The word "transform" matches. But batch transform runs model inference on stored datasets, not stream records.
C. Manual data entryWrong
Manual entry is not a streaming pattern.
D. Model distillationWrong
Distillation is a model training technique.
In practice
- Make the function idempotent, since records can be retried.
- Watch iterator age to spot a consumer falling behind.
Use case
An illustrative scenario, not a real incident.
A Lambda consumer normalizes currency and timestamps on each payment event before writing features.
See how it works
flowchart LR K["Kinesis stream"] --> L["Lambda: clean and enrich"] L --> F["Feature Store online store"] F --> M["Real-time model"]
How to read this chart
- Read it in order: Kinesis stream, then Lambda: clean and enrich, then Feature Store online store, then Real-time model.