Domain 1: Data Preparation for ML and AI (Part 1 of 2)
This lesson covers 5 exam topics: Data Sources and Storage Choices, Streaming Ingestion and Transformation, Data Formats and Merging Sources, Vector Stores and Multimodal Data, Transformation Tools: Glue, DataBrew, EMR, Data Wrangler. Each topic has a short video, then the notes: key facts, exam traps and what to check in the official docs.
1. Data Sources and Storage Choices
Central question: Where does training data live, and how does it reach a training job fast and cheaply?
Sources named in the guide
Amazon S3 (the default data lake), Amazon EBS (block storage on an instance), Amazon EFS (shared NFS file system), Amazon RDS (relational), Amazon DynamoDB (key-value), Amazon OpenSearch Service (search and vectors).
Getting data into SageMaker AI training
| Input | How | Use when |
|---|---|---|
| S3, File mode | Downloads the whole dataset to the instance first | Small/medium data; the volume must fit it all |
| S3, Fast file mode | POSIX file view; streams S3 objects on demand; training starts without full download | Large data; random access OK; works best sequentially |
| S3, Pipe mode | Streams from S3 through a FIFO pipe; largely replaced by fast file mode | Legacy streaming |
| Amazon FSx for Lustre | Mounted file system; hundreds of GB/s throughput, millions of IOPS | Very high-throughput, repeated training |
| Amazon EFS | Mounted shared file system | Data already in EFS |
S3 Express One Zone directory buckets are supported for file, fast file and pipe modes (verified).
Choosing storage (skill 1.1.2; design guidance)
Weigh cost (S3 cheapest at scale; storage classes), performance (FSx for Lustre fastest for training), data structure (tables in RDS/Redshift, objects in S3, key-value in DynamoDB) and compliance (encryption, Region, retention).
Troubleshooting capacity (skill 1.1.3; design guidance)
| Symptom | Fix |
|---|---|
| "No space left on device" in File mode | Fast file mode, or a larger EBS volume |
| Training waits a long time before starting | Fast file mode (no full download) |
| GPU idle, waiting on I/O | FSx for Lustre, more parallel reads, bigger files |
| Many tiny files slow | Combine into larger files (e.g. Parquet, TFRecord) |
Exam traps
- File mode for a dataset larger than the instance disk.
- Pipe mode as the modern default. Fast file mode largely replaces it.
- Millions of tiny files in S3 for training.
2. Streaming Ingestion and Transformation
Central question: How do you ingest and transform data that arrives continuously?
AWS streaming services
| Service | Does | Use when |
|---|---|---|
| Amazon Kinesis Data Streams | Collect and process streams of data records in real time; consumers (KCL apps, Lambda) read the stream | Custom real-time processing, multiple consumers |
| Amazon Data Firehose | Fully managed delivery of streaming data to S3, Redshift, OpenSearch, Iceberg tables, HTTP endpoints | Land streams in storage with little code |
| Amazon Managed Service for Apache Flink | Run Apache Flink in Java, Scala, Python or SQL for stateful stream analytics (windows, joins); managed scaling and checkpoints | Real-time aggregations and features |
| Amazon MSK | Managed Apache Kafka | Existing Kafka ecosystems |
Transforming streams (skill 1.2.3)
- AWS Lambda: lightweight per-record transforms (parse, filter, enrich) — e.g. Firehose data transformation or a Kinesis consumer (general background).
- Spark (Structured Streaming on EMR or Glue streaming jobs) for heavier transforms.
- Flink for windowed, stateful computations (e.g. "transactions per card in the last 5 minutes" as a fraud feature).
Streamed features can be written to the SageMaker Feature Store online store for real-time inference (06).
Exam traps
- Firehose for complex stateful analytics. Firehose delivers; Flink computes.
- Batch jobs for second-level freshness.
- Kinesis Data Streams to "just land data in S3" when Firehose does it with no code.
3. Data Formats and Merging Sources
Central question: Which file format fits the access pattern, and how do you combine sources?
Formats (general background)
| Format | Layout | Strength | Use for |
|---|---|---|---|
| Apache Parquet | Columnar, compressed | Reads only needed columns; small files | Analytics, feature tables, training on subsets of columns |
| Apache ORC | Columnar, compressed | Similar to Parquet; Hive ecosystem | Big-data tables |
| CSV | Row-based text | Simple, universal; no schema | Small data, interchange, some built-in algorithms |
| JSON / JSON Lines | Row-based, nested | Flexible structure | Logs, events, FM fine-tuning datasets (JSONL) |
Choose by access pattern: column scans and large tables → Parquet/ORC; record-by-record streaming or nested data → JSON Lines; simple interchange → CSV (design guidance).
Merging sources (skill 1.1.6)
- AWS Glue ETL jobs (Spark-based, serverless) join and transform data from S3, JDBC databases and catalogued tables; the Glue Data Catalog stores schemas.
- Apache Spark on Amazon EMR for large or custom joins.
- Programming (pandas, SQL in Athena) for smaller merges.
- Watch for key mismatches, time alignment (join on event time, avoid future leakage) and duplicate records after joins.
Exam traps
- CSV for wide tables queried a few columns at a time.
- Joining on wall-clock time so training features include information from after the label event (target leakage).
- Running a cluster for a small one-off merge that Athena or Glue handles serverlessly.
4. Vector Stores and Multimodal Data
Central question: Where should embeddings live, and how do you store text, images and audio for AI?
Vector stores named in the guide
| Store | Notes |
|---|---|
| Amazon OpenSearch Service | k-NN search (Euclidean, cosine); Serverless option; hybrid search with text |
| Amazon RDS with pgvector (also Aurora PostgreSQL) | Vectors next to relational data |
| Amazon S3 Vectors | Vector buckets and vector indexes; purpose-built, cost-optimized; subsecond latency for infrequent queries, as low as 100 ms for frequent ones; strongly consistent writes; no infrastructure to provision |
Configure by specification: dimensions (match the embedding model), distance metric, index type, expected vector count, query rate and latency target, filtering needs (design guidance).
Choosing (design guidance)
| Need | Pick |
|---|---|
| Lowest cost, large archive, modest query rates | S3 Vectors |
| High QPS, hybrid keyword + vector, complex filters | OpenSearch |
| Vectors joined with relational data | RDS/Aurora with pgvector |
| Managed RAG pipeline | Bedrock Knowledge Bases (any supported store) |
Multimodal data (skill 1.1.8)
- Store raw images, audio, video and documents in S3, with metadata (labels, timestamps, source) alongside.
- Convert where needed: Amazon Transcribe for audio to text; Bedrock Data Automation or multimodal FMs to extract structure from documents and images; multimodal embedding models to embed images and text into one vector space.
Exam traps
- Dimension mismatch between the index and the embedding model.
- OpenSearch cluster for a cold archive of vectors queried rarely: S3 Vectors costs less.
- Storing images in a relational database instead of S3 plus metadata.
5. Transformation Tools: Glue, DataBrew, EMR, Data Wrangler
Central question: Which AWS tool should transform this data?
The tools
| Tool | What it is | Pick when |
|---|---|---|
| AWS Glue | Serverless Spark ETL, Data Catalog, crawlers | Code-based, scheduled pipelines at scale |
| AWS Glue DataBrew | Visual, no-code data preparation; 250+ ready-made transformations; serverless; recipes you can re-run | Analysts and data scientists cleaning data without code |
| Spark on Amazon EMR | Managed big-data clusters (Spark, Hive, etc.) | Very large or custom processing; full control |
| SageMaker Data Wrangler | Import, prepare, transform, featurize and analyze data with little code; data quality and insights report; target leakage analysis | ML-specific preparation inside SageMaker; now part of SageMaker Canvas |
| SageMaker Processing | Run your own scripts on managed instances | Custom preprocessing, evaluation steps in pipelines |
Note (verified): Data Wrangler has been integrated into SageMaker Canvas; in the new Studio experience you use Data Wrangler through Canvas, which adds a natural-language interface.
Exam traps
- EMR cluster for a small, visual clean-up that DataBrew does serverlessly.
- DataBrew for complex, code-heavy logic that belongs in Glue or Spark.
- Looking for Data Wrangler in Studio Classic only. It now lives in Canvas.
References
- MLA-C02 Domain 1 — checked Oct 19, 2026
- SageMaker training data access — checked Oct 19, 2026
- Kinesis Data Streams — checked Oct 19, 2026
- Amazon Data Firehose — checked Oct 19, 2026
- Managed Service for Apache Flink — checked Oct 19, 2026
- AWS Glue — checked Oct 19, 2026
- Amazon S3 Vectors — checked Oct 19, 2026
- OpenSearch k-NN — checked Oct 19, 2026
- AWS Glue DataBrew — checked Oct 19, 2026
- SageMaker Data Wrangler — checked Oct 19, 2026
- Data preparation in Canvas — checked Oct 19, 2026
Check your understanding
Start training on 5 TB in S3 without waiting for a download?Show answerHide answer
Answer
Fast file mode.Land clickstream events in S3 as Parquet, minimal code?Show answerHide answer
Answer
Amazon Data Firehose.Training reads 5 of 300 columns from a huge table. Format?Show answerHide answer
Answer
Parquet (columnar).Cheapest vector storage for billions of rarely queried vectors?Show answerHide answer
Answer
Amazon S3 Vectors.Analyst cleans a dataset visually, no code, repeatable?Show answerHide answer
Answer
AWS Glue DataBrew (recipe).