Lesson 2 of 5 ML Data Sources, Storage and Formats

Choosing Storage for ML Data by Cost, Performance, Structure and Compliance

This lesson explains how storage decisions balance cost, performance, data structure and compliance, and how to choose the option that serves the dominant factor without breaking the others.

Learning outcomes

After completing this lesson, you will be able to:

  • Reduce cost with storage classes and lifecycle rules.
  • Choose storage that keeps accelerators supplied with data.
  • Match storage to the structure of the data and compliance rules.

Cost: storage classes and lifecycle rules

ML projects accumulate raw data, intermediate datasets, checkpoints and model artefacts that are rarely read after a few weeks. S3 storage classes price storage by access frequency. S3 Standard suits active datasets; S3 Intelligent-Tiering moves objects between tiers automatically when access patterns are unknown; S3 Standard-IA suits data read occasionally; and the S3 Glacier classes suit archives such as old training snapshots kept for audits.

Lifecycle rules transition objects to cheaper classes after a set age and expire temporary files such as old checkpoints. Applying them by prefix, for example checkpoints/ or raw/, keeps active data in Standard while archiving the rest.

The following diagram shows the storage design for a hospital group's archive of medical scans: where a scan is stored as it ages and the controls that protect it.

Storage for the hospital group's scans. A lifecycle rule moves new scans from S3 Standard to Standard-IA at 30 days and to Glacier Flexible Retrieval at 180 days. Every training set used for a released model is copied to a bucket with Object Lock in compliance mode for seven years. FSx for Lustre is linked to the active prefix during training, and everything stays in EU Regions.
The time axis uses a square-root scale so that short periods remain visible.
Sort into groups

Choose the storage class

Exam skills 1.1.2

Choose the S3 storage class that suits how often each dataset is read.

Log in to try this activity Interactive activities are free with an account.

Performance: throughput and latency

Training performance depends on how quickly data reaches the accelerators. S3 scales to very high aggregate throughput, especially when requests are spread across prefixes. FSx for Lustre provides sub-millisecond latency and hundreds of gigabytes per second for distributed training. S3 Express One Zone offers single-digit millisecond access in one Availability Zone, which suits repeated reads of small objects during training. EFS suits shared home directories and moderate datasets, and EBS suits the local volume of a single instance.

Scenario questions

Feed the GPUs

Exam skills 1.1.2 · 1.1.3

Choose storage that meets a training job's throughput or latency need.

Log in to try this activity Interactive activities are free with an account.

Structure and compliance

The structure of the data suggests the store: objects such as images and documents belong in S3; curated tabular data belongs in S3 as Parquet, in a data warehouse such as Amazon Redshift or as features in SageMaker Feature Store; embeddings belong in a vector store; and low-latency key lookups belong in DynamoDB or the Feature Store online store.

Compliance requirements add controls. Encrypt data at rest with AWS KMS customer managed keys when the organisation must control key policies and rotation. Turn on S3 Block Public Access. Use S3 Object Lock in compliance mode when training datasets or model versions must be kept unchanged for audits. Keep data in Regions that satisfy residency laws, and use Amazon Macie to discover personal data that should be masked before training.

The following table summarises the factors and the matching storage choices.

Dominant factorTypical choice
Lowest cost for data rarely readS3 Standard-IA or Glacier classes with lifecycle rules
Unknown access patternS3 Intelligent-Tiering
Highest training throughputFSx for Lustre linked to S3
Shared file system for notebooksAmazon EFS
Immutable audit copiesS3 Object Lock (compliance mode)
Customer-controlled encryptionSSE-KMS with a customer managed key
Match the pairs

Meet the compliance rule

Exam skills 1.1.2

Match each compliance requirement with the S3 feature that meets it.

Log in to try this activity Interactive activities are free with an account.
Worked example

A medical imaging archive

A hospital group stores 300 TB of de-identified scans for model training. New scans are used heavily for the first month, then rarely, but every scan used to train a released model must be kept unchanged for seven years. Data must stay in the EU.

RequirementConfiguration
Heavy use in the first month, rare laterLifecycle rule: Standard to Standard-IA at 30 days, Glacier Flexible Retrieval at 180 days
Training datasets unchanged for seven yearsCopy each released training set to a bucket with Object Lock compliance retention of 7 years
EU residencyBuckets and training jobs only in EU Regions
Fast distributed training on new scansFSx for Lustre linked to the active prefix during training runs

Putting everything in S3 Standard would meet the functional needs at several times the cost, and relying on versioning alone would not stop authorised users from deleting versions, which the audit requirement rules out.

Check yourself

Which storage gives the highest throughput for distributed training?

Show answer

Amazon FSx for Lustre.

Exam Tips

Remember for the exam

  • Unknown or changing access patterns: S3 Intelligent-Tiering.
  • Expire old checkpoints and temporary files with lifecycle rules.
  • Highest throughput for distributed training: FSx for Lustre.
  • Write-once retention for audits: S3 Object Lock in compliance mode.
  • Residency requirements constrain the Regions used for storage and processing.