Optimizing Storage Costs with Amazon S3 Tiers: My Experience

Optimizing Storage Costs with Amazon S3 Tiers: My Experience

This article shares how I optimized storage costs using Amazon S3 tiers—hot, cold, and Glacier—by applying lifecycle policies.

When working with large datasets, one of the biggest challenges is balancing cost and availability. Not every file needs to be accessed daily, and that’s where Amazon S3 storage tiers became a game changer for me.

Why Amazon S3 Over Other Options?

When comparing storage solutions, Amazon S3 stands out because of its global reliability, flexibility, and ecosystem integration. Unlike traditional file systems or other cloud storage providers, S3 offers:
  • 11 nines of durability (99.999999999%) backed by automatic replication across multiple Availability Zones.
  • Seamless integrations with AWS services (Athena, Redshift, Lambda, SageMaker, CloudFront), enabling analytics, AI/ML, and content delivery without moving data.
  • Fine-grained security with IAM, bucket policies, and encryption options for compliance.
  • Cost flexibility with a wide range of tiers (Standard, Intelligent-Tiering, Glacier, Deep Archive), making it suitable for both hot data and decades-long archives.
  • Global reach with AWS’s infrastructure, ensuring low latency and scalability for enterprises of any size.
In short, S3 combines scalability, cost efficiency, and ecosystem depth that very few storage services can match, which is why I chose it for my workload.

Real-World Use Case: Media Streaming Platform

For a media streaming workload, storage costs can quickly spiral as content libraries grow. I used Amazon S3 with tiered storage to balance performance and cost:
  • Hot Tier (S3 Standard): Latest movies, trending shows, and frequently streamed content remained in S3 Standard for fast delivery through CloudFront.
  • Cold Tier (S3 Standard-IA): Older episodes or less popular titles were transitioned to S3 Standard-IA—still available quickly but at a fraction of the cost.
  • Glacier Tier: Rarely watched content, archives, and compliance backups (like original masters) were moved to Glacier, ensuring long-term retention at the lowest possible cost.
This approach provided a scalable content library where end-users always had smooth streaming for popular titles, while the platform saved significantly on storage costs for rarely accessed content. The seamless integration of S3 with CloudFront, MediaConvert, and Lambda made it possible to build a complete media pipeline without complex overhead.

Why S3 Tiers?

Amazon S3 provides multiple storage classes that let you optimize costs without sacrificing durability:
  • S3 Standard (Hot tier) – for frequently accessed data.
  • S3 Standard-IA / S3 One Zone-IA (Cold tier) – for data accessed less often but still needs quick retrieval.
  • S3 Glacier / Glacier Deep Archive – for long-term archival with very low costs.

How I Used It

I designed a workflow where:
  • Hot data (frequently accessed logs, user uploads) stayed in S3 Standard.
  • Cold data (reports, historical files) moved to S3 Standard-IA after 30 days.
  • Archival data (compliance backups, old media files) was transitioned to S3 Glacier automatically using Lifecycle Policies.
This tiered approach gave me:
  • 60%+ cost savings without changing how applications accessed the data.
  • Seamless retrieval—hot and cold storage is instantly available, while Glacier data is still retrievable when needed.
  • Automation—no manual intervention thanks to lifecycle rules.

Three Step Decision Process

When deciding how to place data in S3 tiers, I followed a three-step decision process:

1. Identify Access Patterns

Files that were frequently accessed (daily/weekly) were classified as Hot Data.
Files accessed occasionally (monthly/quarterly) were marked as Cold Data.
Files kept only for compliance or archival were categorized as Archive Data.

2. Match Data with the Right Tier

Hot Data → S3 Standard (Hot Tier): User uploads, trending media, and active logs stayed in Standard for fast, low-latency access.
Cold Data → S3 Standard-IA (Cold Tier): Monthly reports, older content, and less popular media moved here after 30 days.
Archive Data → S3 Glacier: Compliance backups and historical files transitioned to Glacier after 6 months.

3. Automate with Lifecycle Rules

Lifecycle policies enforced these transitions automatically.
Tags like content=trending or content=archive helped apply rules at object level.
This structured process ensured that every file was stored at the most cost-effective tier without impacting application performance.

How We Implemented It

To put this into action, I used a combination of S3 lifecycle policies, bucket organization, and IAM security controls.
1. Lifecycle Policies for Automated Tiering
We created lifecycle rules to automatically transition objects across storage classes:
{ "Rules": [ { "ID": "MoveToColdStorage", "Prefix": "media/", "Status": "Enabled", "Transitions": [ { "Days": 30, "StorageClass": "STANDARD_IA" }, { "Days": 180, "StorageClass": "GLACIER" } ], "Expiration": { "Days": 1825 } } ] }
After 30 days, files moved to Standard-IA (Cold).
After 180 days, they transitioned to Glacier.
After 5 years, they were deleted automatically to control costs.
  1. Bucket Organization
Buckets were structured by environment (dev/, staging/, prod/) and content type (media/, backups/).
Object tagging was applied (tag:content=trending, tag:content=archive) to track usage and apply targeted lifecycle rules.
  1. Python function I used to upload files:
import boto3 from botocore.exceptions import NoCredentialsErrordef upload_to_s3(file_name, bucket, object_name=None, storage_class="STANDARD"): # Use file name if object_name not provided if object_name is None: object_name = file_name s3 = boto3.client("s3") try: s3.upload_file( Filename=file_name, Bucket=bucket, Key=object_name, ExtraArgs={ "StorageClass": storage_class, "Tagging": "content=media" } ) print(f"Uploaded {file_name} to s3://{bucket}/{object_name} [{storage_class}]") except FileNotFoundError: print("The file was not found.") except NoCredentialsError: print("AWS credentials not available.")# Example usage: # upload_to_s3("movie.mp4", "my-media-bucket", storage_class="STANDARD_IA")

Lessons Learned

  • Plan lifecycle policies carefully: moving to Glacier too early can cause higher retrieval costs.
  • Monitor access patterns using S3 Storage Lens before deciding transitions.
  • Always tag your buckets and objects for visibility and cost tracking.

What’s Next?

I want to explore S3 Intelligent-Tiering, which automatically optimizes costs by moving objects across tiers based on real usage, removing guesswork entirely.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article