Study Guide865 words

AWS Storage Strategy for Machine Learning: Cost, Performance, and Structure

Making initial storage decisions based on cost, performance, and data structure

AWS Storage Strategy for Machine Learning: Cost, Performance, and Structure

This guide outlines the critical factors for selecting AWS storage solutions and data formats during the initial phases of a Machine Learning (ML) project. Choosing the right foundation directly impacts training speed, model accuracy, and operational costs.

Learning Objectives

  • Analyze storage requirements based on data structure (structured vs. unstructured).
  • Evaluate AWS storage services (S3, EBS, EFS, FSx) against cost and performance metrics.
  • Select appropriate data formats (Parquet, ORC, JSON, CSV) to optimize data access patterns.
  • Identify native integrations with Amazon SageMaker for efficient data ingestion.

Key Terms & Glossary

  • Object Storage: A hierarchy-less method of storing data as objects (data + metadata + unique identifier). Example: Amazon S3.
  • Block Storage: Data is broken into blocks and stored as separate pieces with unique identifiers. Example: Amazon EBS.
  • File Storage: Data is stored in a hierarchical folder structure. Example: Amazon EFS.
  • Throughput: The amount of data moved from one place to another in a given time period.
  • Durability: The probability that a data object will remain intact and accessible over a period of time (e.g., "11 nines").

The "Big Idea"

In Machine Learning, storage is not just a place to put files; it is a performance bottleneck. The transition from a Data Lake (S3) to a high-speed training environment (FSx/EFS) requires a balance: keeping data cheap for long-term storage while ensuring it is "fast enough" for GPUs to process without idling.

Formula / Concept Box

Decision FactorPreferred AWS ServiceUse Case Prompt
Lowest CostAmazon S3"Where should I store 50TB of raw images for a year?"
Highest PerformanceAmazon FSx for Lustre"How do I minimize training time for a deep learning model?"
Shared AccessAmazon EFS"How do 100 Jupyter notebooks access the same dataset?"
Single InstanceAmazon EBS"What is the best local disk for my SageMaker notebook?"

Hierarchical Outline

  • I. Storage Selection Criteria
    • Data Type: Unstructured (Images/Video) vs. Structured (Tables/Logs).
    • Access Patterns: Concurrent access vs. individual instance attachment.
    • Performance: Throughput requirements and latency sensitivity.
  • II. Primary AWS Services
    • Amazon S3: Scalable object storage; the central data lake.
    • Amazon EBS: Persistent block storage; local performance for one instance.
    • Amazon EFS: Managed file storage; shared access for multiple instances.
    • Amazon FSx for Lustre: High-performance file system; integrated with S3.
  • III. Data Formats
    • Row-based (CSV/JSON): Human-readable, easy to debug, slow for large-scale ML.
    • Columnar (Parquet/ORC): Compressed, efficient for querying specific features.

Visual Anchors

Storage Selection Logic

Loading Diagram...

Cost vs. Performance Trade-off

\begin{tikzpicture} \draw[thick,->] (0,0) -- (6,0) node[right] {Performance (Throughput)}; \draw[thick,->] (0,0) -- (0,5) node[above] {Cost per GB}; \filldraw[blue] (0.5,0.5) circle (3pt) node[right] {S3 (Standard)}; \filldraw[orange] (3,2.5) circle (3pt) node[right] {Amazon EFS}; \filldraw[red] (5.5,4.5) circle (3pt) node[below left] {FSx for Lustre}; \draw[dashed, gray] (0.5,0.5) -- (5.5,4.5); \node at (3,-1) {\small Comparison of common ML storage layers}; \end{tikzpicture}

Definition-Example Pairs

  • Durability vs. Availability: Durability is not losing the data; availability is being able to get the data right now.
    • Example: S3 Standard-IA has high durability (99.999999999%) but lower availability than S3 Standard because it is intended for infrequent access.
  • Columnar Format: A data storage format where values are stored together by column rather than row.
    • Example: Using Parquet for a dataset with 500 features. If your model only needs 10 features, the system only reads those 10 columns, reducing I/O significantly compared to a CSV.

Worked Examples

Scenario 1: The Image Recognition Project

Problem: You have 1 million 4K images. You need to store them cheaply but train a model on them using SageMaker. Decision:

  1. Storage: Store raw images in Amazon S3.
  2. Format: Keep as original JPG/PNG but consider using SageMaker Fast File Mode to stream them directly from S3 to the training instances to avoid downloading time.

Scenario 2: High-Performance Genomic Research

Problem: A team needs sub-millisecond latency for a dataset that is constantly being updated by multiple compute nodes. Decision:

  1. Storage: Use Amazon FSx for Lustre.
  2. Integration: Link the FSx file system to an S3 bucket. FSx will "lazy load" metadata from S3, providing the performance of a local disk with the scale of an object store.

Checkpoint Questions

  1. Which storage service is the most cost-effective for a long-term data lake?
  2. If multiple EC2 instances need to read and write to the same shared directory, which service should you choose?
  3. Why is Parquet preferred over CSV for large-scale Machine Learning training?
  4. What is the difference between a "scratch" and "persistent" file system in FSx for Lustre?

Muddy Points & Cross-Refs

[!TIP] Common Confusion: FSx vs. EFS While both are shared file systems, remember: EFS is general-purpose (good for home directories and web serving), while FSx for Lustre is purpose-built for high-performance computing (HPC) and ML. If the exam mentions "high throughput" or "sub-millisecond latency," think FSx.

Cross-References:

  • Data Engineering: See "AWS Glue" for converting CSV to Parquet.
  • Model Training: See "SageMaker Input Modes" (File vs. Pipe vs. Fast File).

Comparison Tables

AWS Storage Service Comparison

FeatureAmazon S3Amazon EBSAmazon EFSAmazon FSx for Lustre
Storage TypeObjectBlockFile (NFS)File (Lustre)
Shared?Yes (Global)No (Single AZ/Instance)Yes (Region-wide)Yes (Region-wide)
PriceLowest ($)Moderate ($$)High ($$$)High ($$$)
Best ForData LakesBoot VolumesShared code/notebooksTraining Performance
PerformanceHigh LatencyLow LatencyModerateUltra-low Latency

Ready to study AWS Certified Machine Learning Engineer - Associate (MLA-C01)?

Practice tests, flashcards, and all study notes — free, no sign-up needed.

Start Studying — Free