Cloud Deployment for ML (AWS-First) · 50 min · AWS S3 · AWS Athena · Parquet
Data, Storage & Cost on AWS
The cloud bill is a design review you didn't know you were having. Lay out data so it's cheap to use.
Hiring signal: Reasons about storage layout and cloud cost like an owner
What you will learn
- Lay out an S3 data lake with partitioning for cheap queries
- Query data in S3 with Athena without loading it elsewhere
- Choose S3 storage classes and lifecycle policies by access pattern
- Identify the main cloud cost drivers for ML workloads
- Apply concrete cost-optimization levers
The Problem
Two teams store the same 5 TB of training data. One pays \$120/month and queries it in seconds; the other pays \$2,000/month and waits minutes per query. The data is identical — the layout and storage choices differ. Cloud cost and performance are mostly a function of how you organize data, and "why is our bill so high?" is a question ML engineers are increasingly expected to answer. This is also a favorite system-design probe.
This lesson is about storing ML data so it's cheap to keep and cheap to use.
The Concept
Three decisions drive both cost and speed:
You store 500GB of training data as CSV in S3 Standard. Your Athena queries scan the full dataset each time, costing ~$1.25/query. What two changes cut this cost most?
Parquet is columnar: Athena only scans the columns you SELECT, not entire rows. It's also ~10x smaller than CSV due to encoding. Partitioning by date means WHERE dt = '2024-06-01' reads only that folder. Together: 500GB CSV → ~50GB Parquet, and a single-day query scans ~170MB instead of 500GB. Cost drops from $1.25 to ~$0.004/query.
1. Format : columnar (Parquet) vs row (CSV/JSON) -> scan less, pay less
2. Layout : partitioning by a filter column -> read only what you need
3. Class : hot vs cold storage + lifecycle -> stop paying for cold data hot
And the cost drivers you're billed on:
Compute (instance-hours, the usual #1) · Storage (GB-month)
Requests (per-1000 API ops) · Egress (data out to the internet)
Query scan (Athena bills per TB scanned)
Unlock the full lesson
You've read the first 2 sections. The rest of this lesson covers Build It, Use It, Ship It, Evaluation, Exercises, Key Terms, Common Pitfalls, Interview Framing — plus a hands-on lab, quiz, and project artifact.
Create a free account to unlock Phase 0 and Phase 1 of every course — no credit card.
Browse all courses · View pricing · DeVenture Academy