Optimizing Machine Learning with S3 Storage Classes: A Crop Yield Prediction Case Study

Santosh Shinde
5 min read1 day ago

--

Did you know inefficient storage can inflate ML costs by 20–30% or delay insights when they’re most needed? Amazon S3’s storage classes are here to fix that.

Introduction

Machine learning (ML) thrives on data, but effectively managing it is crucial. Amazon Simple Storage Service (S3) offers a suite of storage classes tailored to different access needs, making it a game-changer for ML workflows. From training models to delivering real-time predictions or archiving old datasets, S3 helps us optimize speed, cost, and scale. To bring this to life, let’s dive into a practical example: using ML to predict crop yields for a 50,000-acre cornfield.

Data powers ML, and smart storage keeps it flowing.

What Are S3 Storage Classes and Why Do They Matter?

Before diving into their application in machine learning, it’s essential to understand what S3 storage classes are.

S3 isn’t just a bucket—it’s a toolbox. Each storage class is designed for a specific job, balancing access speed, durability, and cost.

S3 Storage Classes
  • S3 Standard: High-performance storage for frequently accessed data with low latency and high throughput.
  • S3 Intelligent-Tiering: Automatically adjusts between frequent and infrequent access tiers based on usage patterns.
  • S3 Standard-Infrequent Access (Standard-IA): Designed for rarely accessed data that still requires rapid retrieval.
  • S3: One Zone-Infrequent Access (One Zone-IA): Stores data in a single availability zone for infrequently accessed, non-critical datasets.
  • S3 Glacier: Archival storage for data accessed occasionally, with retrieval times from minutes to hours.
  • S3 Glacier Deep Archive: Long-term storage for rarely accessed data, with retrieval taking up to 12 hours.

We can determine the necessary storage class based on our use case. For example, the S3 Standard storage class can be used to store training data for a machine learning model, while the S3 Standard IA can be used to store less frequently accessed data, such as model artifacts.

S3 Storage Class — Use Cases

Need help choosing? S3’s Storage Class Analysis tool can crunch usage patterns and recommend the best fit. The goal? Match your data’s role in the ML pipeline—whether it’s hot training data or cold archives—to the right class.

Real-World Example: Predicting Crop Yields with ML

Imagine we have 50,000 acres of cornfields. Our mission: predict this year’s yield to optimize planting, fertilizing, and sales. We’ll use a mix of historical and real-time data—satellite imagery, 10 years of weather records, and soil samples—to train an ML model.

Use Case — Crop Yield Prediction

The challenge? Keeping 270+ TB of data organized and accessible across five stages: collection, preprocessing, training, daily predictions, and long-term storage.

Here’s how we map S3 classes to each step.

Our Data

Our Data and How We’ll Use It

Raw Data

  • What: a huge pile—200 TB of satellite images, 50 TB of weather history, and 20 TB of soil records (270 TB total).
  • Our need: Save it once and rarely look at it, maybe for a yearly review or rules check.
  • S3 Choice: S3 Glacier
  • Why: Glacier keeps this big stash safe and out of the way since we won’t need it often, and we’re fine waiting a bit to pull it out when we do.
  • How: We’ll set a rule to move it to Glacier after 60 days of no use.

Preprocessed Data

  • What: 15 TB of cleaned-up data, like simplified images and weather trends. Use it heavily at first to build the model, then just a few times a year to tweak it.
  • Our Need: Work with it a lot at first, then check it a few times a year.
  • S3 Choice: S3 Intelligent-Tiering.
  • Why: It’s quick when we’re busy preparing and building, then adjusts itself for quieter times, staying ready for when we come back to it.
  • How: We’ll put it here and let it switch modes on its own.

Training Data

  • What: 8 TB of the best data we pick to teach the model. Go over it a lot for weeks while the model learns.
  • Our Need: Use it over and over for weeks to teach the model.
  • S3 Choice: S3 Standard.
  • Why: Standard’s speed lets us train without waiting, perfect for the heavy lifting of getting the model ready to predict yields.
  • How: We’ll keep it in Standard while training, then shift it to Intelligent-Tiering when we’re done.

Inference Data

  • What: 100 GB of fresh daily info, like today’s weather and soil updates. Grab it fast every day to predict yields during the growing season.
  • Our Need: Pull it quickly every day for predictions during the growing season.
  • S3 Choice: S3 Standard.
  • Why: Standard keeps things snappy so we can give farmers instant updates, like whether to water today.
  • Method: We will store it in Standard and refresh it daily.

Model Artifacts

  • 2 GB of finished models and old versions. Store them and check them occasionally for updates or reviews.
  • Our Need: Look at them now and then for updates or checks.
  • S3 Choice: S3 Standard-IA.
  • Why: Standard-IA is excellent for small models we only need sometimes, offering quick access when we do.
  • How: We’ll save them with version tracking in Standard-IA.
use case-Crop Yield Prediction

Why This Works for Us

  • Speed: S3 Standard powers rapid training and predictions—farmers get answers when they need them, not tomorrow.
  • Savings: Glacier and Intelligent-Tiering slash costs for idle data, freeing budget for innovation. In our case, this cut storage expenses by 25%.
  • Scale: As our fields or data grow, S3’s rules (e.g., lifecycle policies) keep everything tidy—no chaos, just results.

Final Thoughts

S3 storage classes aren’t just about stashing data—they’re about unlocking ML’s full potential. By aligning storage with access needs—fast for training, flexible for prep, and cheap for archives—we streamline workflows and turn raw data into actionable insights.

References

Do you have any suggestions for ML storage tricks? Drop a comment—I’d love to hear how you’re using S3! Thank you for reading, and if this post has been helpful, a clap or share would be greatly appreciated.

Please follow me for further updates and look forward to your comments.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Written by Santosh Shinde

Lead Software Engineer @Syngenta | #mlops #nodejs #typescript #reactjs #python #followme @ https://www.linkedin.com/in/shindesantosh/

No responses yet

Write a response