VAYULearn
Colour theme
Investigate a failure
VAYU Learn

AWS Data Engineering

How to Optimize Cloud Storage Costs

AWS S3, Azure ADLS, GCP GCS — What Actually Saves Money

AWS Data EngineeringDatabricks & LakehouseData Architecture & Reliability
Figure 1 - Good and Bad Cloud Storage Layouts Have Radically Different Cost Profiles

Cloud object storage is inexpensive for raw bytes but expensive when poorly accessed.
File size, partitioning strategy, and read amplification determine cost far more than total data volume.

You don’t optimize cloud storage by deleting data — you optimize it by eliminating unnecessary reads.

TL;DR

  • Cloud storage is cheap only when access patterns are sane
  • Most storage bills come from bad layout, not data volume
  • Small files cost more than cold data
  • Read amplification is the silent killer
  • Lifecycle rules save money only if partitioning is correct
  • You don’t optimize storage after pipelines — you design for it

If your storage bill keeps growing while data value doesn’t, this blog is for you.


Who This Is NOT For (Read This First)

This post is not for you if:

  • your total data is under ~5 TB
  • only one team queries the data
  • queries are ad-hoc experiments
  • schemas change weekly
  • cost is not yet a business concern

If that’s your situation, stop reading and move fast.
Optimization too early is just fear in disguise.

This post is for teams where:

  • storage cost grows faster than business value
  • multiple consumers hit the same datasets
  • backfills and retries are routine
  • no one can explain why the bill is increasing

If that sounds familiar, keep going.


Introduction — Why Storage Costs Sneak Up on Teams 💸

Storage is sold as:

“Cheap, infinite, durable.”

Reality:

  • storage is cheap
  • access is not
  • metadata is not
  • bad design compounds monthly

Most teams notice storage costs last, because:

  • pipelines “work”
  • dashboards load
  • nothing is broken

Until finance asks:

“Why did our S3 bill triple?”

Storage cost optimization is not a cloud trick.
It’s data engineering discipline.


🧠 1. The Real Cost Model (What You’re Actually Paying For)

Cloud object storage charges you for four things:

  1. Stored bytes (GB/month)
  2. Requests (PUT, GET, LIST)
  3. Data transfer (egress, cross-region)
  4. Metadata & indexing overhead

Most teams obsess over #1.
Most bills explode because of #2 and #4.

🧾 1.5 Cost Attribution: Storage Costs Are an Org Design Problem

Storage costs scale with organizational behavior, not just data volume.

Common anti-patterns:

  • ingestion teams control layout
  • analytics teams control access
  • finance sees the bill
  • no one owns the outcome

When cost ownership is unclear:

  • producers over-partition
  • consumers over-scan
  • optimizations never stick

Production-grade practices:

  • tag buckets by domain / owner
  • publish cost dashboards per dataset
  • make producers accountable for layout
  • make consumers accountable for access patterns
  • treat storage layout as a public contract

If no one feels the cost of a bad partition, it will never be fixed.

Rule:

You can’t optimize what no one owns.

How Engines Turn Bad Layouts Into Bills
Storage costs don’t explode in isolation — engines amplify them.

  • Spark
    Bad partitioning = task explosion
    Small files = excessive GET requests
    Result: slow jobs and inflated request costs
  • Trino / Presto / Athena
    Planning requires listing files
    High file counts = expensive LIST operations
    Result: high latency before queries even start
  • BI Tools
    SELECT * is the default
    Filters are often applied after reads
    Result: full scans that look “cheap” but aren’t

If storage layout is wrong, engines will punish you quietly and repeatedly.


📦 2. Object Storage Is Not a Filesystem (Stop Treating It Like One)

S3, ADLS, GCS are:

  • key-value object stores
  • optimized for large, immutable objects
  • not hierarchical filesystems

Bad assumptions lead to:

  • millions of tiny objects
  • excessive LIST operations
  • slow queries
  • high request costs

If you think in “folders”, you’re already wrong.


📉 3. The Small Files Problem (The #1 Cost Multiplier)

Small files kill you in three ways:

  • metadata overhead
  • excessive requests
  • read amplification in engines

Example:

  • 10 million files × 50 KB each
  • vs 10,000 files × 50 MB each

Same data volume.
Wildly different cost and performance.

Why small files happen

  • streaming writes per event
  • Lambda writing per invocation
  • bad micro-batching
  • per-user or per-request outputs

What to do instead

  • batch writes aggressively
  • enforce minimum file sizes (100–500 MB for analytics)
  • compact continuously
  • treat file size as a schema-level decision

Non-Negotiable File Size Targets

If you need concrete rules, use these:

  • Analytics datasets: 128–512 MB per file
  • Streaming sinks: flush on size OR time (whichever comes first)
    – 128 MB OR 1–5 minutes is a sane default
  • Anything under 32 MB is a bug, not a feature

If your system cannot control file size, it is not production-ready.
File size is not an implementation detail — it is a contract.


🧠 4. Partitioning: Your Biggest Lever (And Biggest Mistake)

Partitioning decides:

  • how much data is scanned
  • how many files are touched
  • how effective lifecycle rules are

Bad partitions

  • high-cardinality keys (user_id, session_id)
  • unstable fields
  • nested partitions

Good partitions

  • time (date/hour)
  • coarse-grained business keys
  • predictable access patterns

Rule to remember

Partition for how data is read, not how it arrives.

Most teams do the opposite.

A Simple Partitioning Sanity Test
Before you create a partition, ask:

“Will this eliminate data at query planning time?”

If the answer is no, it’s not a partition — it’s a folder.

Most production tables need:

  • date (always)
  • hour (only if daily volume is massive)
  • one additional coarse business dimension at most

If you need more than 3 partition levels, your design is already broken.


🧊 5. Compression Is Not Optional (But It’s Not Magic)

Compression helps when:

  • columns are similar
  • schemas are stable
  • formats are columnar

Parquet + Snappy/ZSTD usually wins.

But compression:

  • does not fix bad schemas
  • does not fix small files
  • does not fix over-partitioning

If your data shape is garbage, compression just hides the smell.


📊 6. Access Patterns Matter More Than Storage Tier

Hot, warm, cold — these only work if access patterns are honest.

Common lie

“We rarely read this data.”

Reality:

  • ad-hoc queries
  • backfills
  • dashboards
  • retries

If data is accessed once a day, it’s not cold.

Correct strategy

  • separate compute-facing datasets from archive
  • freeze schemas before archiving
  • make cold data hard to query accidentally

Cold data should require intent, not convenience.


🔁 7. Lifecycle Policies (Powerful, Dangerous)

Lifecycle rules save money only if:

  • partitions are correct
  • access patterns are stable
  • consumers know what disappears

Common failure

  • move data to cold tier
  • queries break
  • jobs retry
  • costs spike elsewhere

Lifecycle without governance is cost shifting, not optimization.


🧪 8. Real-World Example: Cutting Storage Costs by 60%

Scenario

  • 200 TB in S3
  • Spark-based analytics
  • exploding request costs
  • slow queries

Problems found

  • files ~5 MB each
  • partitions on user_id
  • frequent LIST operations
  • no compaction

Fixes applied

  • re-partitioned by date
  • enforced 256 MB file size
  • daily compaction jobs
  • removed unused columns
  • lifecycle for raw data only

Result

  • 60% cost reduction
  • 3× faster queries
  • fewer operational issues

Nothing “clever”.
Just correct fundamentals.

⚖️ 8.5 Storage vs Compute: The False Economy

Many teams try to reduce storage costs by:

  • deleting intermediate datasets
  • avoiding materialization
  • recomputing everything on demand

This almost always backfires.

Why:

  • compute is more expensive than storage
  • recomputation amplifies reads
  • retries multiply cost
  • latency suffers

Rule of thumb:

  • store data if it’s read more than once
  • recompute only when data is volatile
  • materialize expensive joins and aggregations

Cheap storage exists to save compute.

Deleting data to save money is often the most expensive decision you can make.

Rule:

Storage optimizes compute.
Compute does not optimize storage.

What Hurt During the Fix
This was not free:

  • compaction jobs lagged for weeks
  • analysts complained about slower ad-hoc queries during transition
  • some dashboards broke due to schema freezes
  • backfills were temporarily disabled to regain control

But after stabilization:

  • operational load dropped
  • query patterns became predictable
  • costs stopped surprising finance

Good storage design always hurts once.
Bad storage design hurts every month.


🚦 9. Cross-Cloud Truths (S3 vs ADLS vs GCS)

Despite branding differences:

  • all punish small files
  • all charge for requests
  • all reward large, immutable objects

Differences are operational, not philosophical.

If your design works on S3, it works everywhere.


🧨 10. Hidden Cost Traps You Must Watch

Silent killers

  • excessive LIST calls
  • schema evolution causing rewrites
  • cross-region reads
  • debug jobs scanning full tables
  • BI tools doing SELECT *

Every one of these costs money without breaking anything.

That’s why they persist.


🧠 11. Storage Cost Mental Models (Lock These In)

  • Storage cost is layout + access, not GBs
  • Small files are debt
  • Partitioning is an API contract
  • Cold data must be boring to access
  • You pay monthly for yesterday’s mistakes

🎯 When Storage Optimization Actually Matters

Optimize aggressively when:

  • analytics scale
  • multiple consumers exist
  • backfills are common
  • costs grow faster than value

Don’t over-optimize when:

  • data is tiny
  • usage is experimental
  • schemas change daily

Optimization is about timing, not heroics.


Conclusion — Storage Is Architecture, Not Configuration ☁️

Cloud storage doesn’t get expensive suddenly.
It gets expensive predictably.

Bad layouts compound.
Bad access patterns repeat.
Bad decisions live forever.

Good storage design:

  • reduces cost
  • improves performance
  • simplifies pipelines
  • scales quietly

If you want to cut cloud bills:
don’t start with discounts.
Start with data engineering fundamentals.

The cheapest data is data that is laid out once and reused forever.

🔥 Next in Series

⚡ Kafka vs Pulsar vs Redpanda

Which Streaming Platform Wins in 2026?

Next, we move from storage to motion:

  • throughput vs latency
  • operational complexity
  • cost trade-offs
  • real-world failure modes

This one will be opinionated.


🔔 Follow for More

Follow TheDataForge for high-signal deep dives on Spark, Kafka, Streaming, Lakehouse, and real-world data engineering — no fluff, only engineering truth.

⚡️Let’s connect — I post daily Big Data & Spark insights at DataForgeX on X.

💬 Comment Below:

What’s burning your storage budget right now?

  • small files?
  • bad partitions?
  • cold data accessed daily?
  • runaway BI queries?

If you fixed it, how?
If you didn’t — why not?

Real examples > theory.


🏷️ Tags

#DataEngineering #CloudStorage #AWSS3 #AzureADLS #GoogleCloudStorage #BigData #ModernDataStack