Stop 05 · Storage ServicesTopics · 9/9

Storage Cost Optimization

Part of the Cloud Computing Roadmap

In short

Storage is cheap per gigabyte, which is exactly why nobody watches it. Then three years of logs, old builds and forgotten snapshots add up to a bill nobody can explain.

Applying lifecycle policies, choosing the right storage class, and cleaning up unused/orphaned data — storage costs compound quietly over time if nobody actively manages them.

The blob character pulls old leftover containers out of a fridge into a bin.

Think of it like this

Cleaning out the fridge

Each leftover dabba looked small when you put it in. A month later the fridge is full of things nobody will eat, and the fresh stuff has no space. Storage costs grow the same way: quietly, one small container at a time.

Watch it happen

Where the storage bill hides

user photos
0
app logs
1
old builds
2
half uploads
3
old snapshots
4
unattached disks
5

1/5A typical account's storage. Only some of it is earning its keep.

The big ideas

What you need to know

Expire by default

Every log or temp prefix should have a lifecycle rule. Data without an end date lives forever.

Right class for the job

Move rarely-read data to infrequent or archive tiers, or let Intelligent-Tiering decide for unknown patterns.

Hunt orphans

Unattached volumes, old snapshots and incomplete uploads are pure waste. Check for them monthly.

Measure first

Tools like S3 Storage Lens and Cost Explorer show which buckets grow fastest. Fix the biggest first.

See it in code

Walk through the code

bash
1# How big is each bucket prefix?2aws s3 ls s3://my-app-logs --recursive --summarize --human-readable | tail -23 4# Unfinished multipart uploads still cost money5aws s3api list-multipart-uploads --bucket my-app-uploads6 7# Old snapshots you own, oldest first8aws ec2 describe-snapshots --owner-ids self \9  --query "sort_by(Snapshots,&StartTime)[].[SnapshotId,VolumeSize,StartTime]" \10  --output table

1/3Total object count and size for a bucket, shown at the end of the listing.

Three quick checks. For big buckets, S3 Storage Lens or inventory reports are faster than listing every object.

Save yourself the pain

Common mistakes

Oops

Deleting old snapshots without checking if any are the only backup.

Do this instead

Check retention rules and tags first. Delete only what's past policy, and keep at least one known-good restore point.

Oops

Turning on versioning and never expiring old versions.

Do this instead

Every overwrite keeps the old copy. Add a lifecycle rule to expire noncurrent versions after some days.

Your mission

Write a cleanup rule set

~25 min

Quick check

A bucket with versioning keeps growing even though the app overwrites the same files. Why?

Go deeper

  1. 1Audit a hypothetical storage account for old, unused, or duplicated data.
  2. 2Calculate the savings from moving infrequently-accessed data to a cheaper storage class.
  3. 3Learn to set up cost alerts specifically for storage spend, which can grow silently.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge