Cost-optimized storage design solves a fundamental problem: organizations store all data at the same tier and never revisit that decision. The result is paying premium rates for data that is rarely or never accessed. AWS provides a spectrum of storage classes and volume types, each trading access speed or durability guarantees for lower cost. Your job as a solutions architect is to match each dataset to the cheapest tier that still meets its access frequency, retrieval latency, and durability requirements.
Understanding the S3 Storage Class Spectrum
Amazon S3 (covered in Chapter 3 for performance) offers multiple storage classes arranged along a cost-performance spectrum. As storage cost per GB decreases, retrieval cost and access latency increase. A single general purpose bucket can contain objects in different storage classes simultaneously, and you can transition objects between classes using lifecycle policies.
S3 Standard is the default class. It stores data redundantly across a minimum of three Availability Zones and provides millisecond access. It is the most expensive per-GB storage option, and appropriate only for frequently accessed data.
S3 Intelligent-Tiering is designed for data with unknown or changing access patterns. It automatically moves objects between a frequent-access tier and an infrequent-access tier based on observed access patterns. You pay a small monitoring and automation fee per object (per 1,000 objects above 128 KB), but there are no retrieval fees and no lifecycle rules to manage. You can optionally enable archive access tiers within Intelligent-Tiering that automatically move objects not accessed for 90 days to an archive tier, and objects not accessed for 180 days to a deep archive tier, delivering savings comparable to Glacier classes with zero operational overhead.
💡 Exam Trap: S3 Intelligent-Tiering does NOT charge retrieval fees when objects move between its internal tiers. This is different from Standard-IA and One Zone-IA, which charge per-GB retrieval fees. When the question says "unknown access pattern and you want to avoid retrieval fees," the answer is Intelligent-Tiering, not Standard-IA.
S3 Standard-Infrequent Access (Standard-IA) offers the same durability and throughput as Standard but at a lower per-GB storage price. It charges a per-GB retrieval fee. It has a minimum storage duration of 30 days and a minimum object size of 128 KB for billing purposes. Objects smaller than 128 KB are billed as 128 KB.
S3 One Zone-Infrequent Access (One Zone-IA) is similar to Standard-IA but stores data in only one Availability Zone. This makes it less expensive but less resilient. It offers 11 nines of durability within that single AZ, but data is lost if the AZ is destroyed. It is ideal for data that can be recreated, such as thumbnails, transcoded media, or replicated copies.
💡 Exam Trap: Both Standard-IA and One Zone-IA have a 30-day minimum storage duration charge. If you store an object for 10 days and then delete it, you still pay for 30 days. The exam tests whether you know about this minimum duration charge when designing lifecycle transitions.
S3 Glacier Instant Retrieval provides the lowest-cost storage for long-lived data that needs millisecond retrieval. It has a minimum storage duration of 90 days and higher retrieval costs than Standard-IA. It is ideal for medical images, news archives, or compliance data that is accessed infrequently (perhaps once per quarter) but must be available immediately when needed.
S3 Glacier Flexible Retrieval (formerly S3 Glacier) is designed for archive data that does not need instant access. Retrieval options are Expedited (1-5 minutes), Standard (3-5 hours), and Bulk (5-12 hours). It has a minimum storage duration of 90 days. Storage cost is significantly lower than Glacier Instant Retrieval.
S3 Glacier Deep Archive is the lowest-cost S3 storage class. Retrieval times are Standard (within 12 hours) or Bulk (within 48 hours). It has a minimum storage duration of 180 days. It is intended for data that is accessed once or twice per year, such as regulatory archives or long-term backups.
💡 Exam Trap: Glacier Deep Archive retrieval takes up to 12 hours (Standard) or 48 hours (Bulk). If a question requires retrieval within minutes, Glacier Deep Archive is wrong. Use Glacier Flexible Retrieval with Expedited retrieval for 1-5 minute access, or Glacier Instant Retrieval for millisecond access.
S3 Express One Zone (introduced in Chapter 3 for performance) is the most expensive per-GB storage class but has the lowest per-request cost. From a cost optimization perspective, Express One Zone is rarely the cheapest option per GB, but it can reduce total cost when high request volumes or repeated reads make request charges the dominant cost component. Machine learning training datasets read hundreds of times during hyperparameter tuning are a typical example where the higher storage cost is offset by lower request charges and reduced compute time.
S3 Storage Class Decision Tree
S3 Lifecycle Policies
S3 Lifecycle policies automate the transition of objects between storage classes and the deletion of expired objects. A lifecycle rule can be scoped to an entire bucket, a prefix (e.g., logs/), or objects matching specific tags.
A typical cost-optimized lifecycle progression:
Day 0-30: S3 Standard (active use)
Day 31-90: S3 Standard-IA (infrequent access)
Day 91-180: Glacier Flexible Retrieval (archive)
Day 181+: Glacier Deep Archive (long-term archive)
Day 365: Delete (expiration)
To create a lifecycle rule via the AWS CLI:
{
"Rules": [
{
"ID": "ArchiveAndExpire",
"Status": "Enabled",
"Filter": {
"Prefix": "logs/"
},
"Transitions": [
{
"Days": 30,
"StorageClass": "STANDARD_IA"
},
{
"Days": 90,
"StorageClass": "GLACIER"
},
{
"Days": 180,
"StorageClass": "DEEP_ARCHIVE"
}
],
"Expiration": {
"Days": 365
}
}
]
}
aws s3api put-bucket-lifecycle-configuration \
--bucket my-logs-bucket \
--lifecycle-configuration file://lifecycle.json
💡 Exam Trap: You cannot transition objects from a lower-cost class to a higher-cost class using lifecycle policies (e.g., from Glacier back to Standard). Lifecycle transitions only move objects "downward" in the cost spectrum. To move data back to Standard, you must copy the object and specify the new storage class.
💡 Exam Trap: There is a minimum 30-day requirement before you can transition from S3 Standard to Standard-IA or One Zone-IA. However, you can transition directly from Standard to any Glacier class at any time (even day 1). The 30-day minimum applies only to IA classes.
S3 Analytics and Storage Lens
S3 Storage Class Analysis monitors access patterns on a bucket or prefix for 30 days and then provides a recommendation about whether to transition objects to Standard-IA. This is useful when you have existing data and do not know its access frequency.
S3 Storage Lens provides organization-wide visibility into storage usage and activity across all accounts and buckets. The free tier provides 28 usage and activity metrics. The advanced tier adds additional metrics, prefix-level aggregation, and recommendations for cost optimization. Storage Lens is the primary tool for identifying cost-saving opportunities across a large S3 footprint.
Eliminating S3 Waste
Several common practices generate hidden S3 costs:
Incomplete multipart uploads are partial uploads that were started but never completed. They consume storage indefinitely until explicitly aborted. Add a lifecycle rule to automatically clean up incomplete multipart uploads:
{
"Rules": [
{
"ID": "AbortIncompleteMultipartUploads",
"Status": "Enabled",
"Filter": {},
"AbortIncompleteMultipartUpload": {
"DaysAfterInitiation": 7
}
}
]
}
Noncurrent object versions accumulate when versioning is enabled. Each version is billed as a separate object. Use lifecycle rules to transition or expire noncurrent versions:
{
"NoncurrentVersionTransitions": [
{
"NoncurrentDays": 30,
"StorageClass": "GLACIER"
}
],
"NoncurrentVersionExpiration": {
"NoncurrentDays": 90
}
}
Delete markers in versioned buckets also consume a small amount of storage. A lifecycle rule can expire delete markers when they are the only remaining version of an object.
EBS Volume Cost Optimization
Amazon EBS volumes (introduced in Chapter 3) represent a major storage cost for EC2-based workloads. The most impactful cost optimization is migrating from gp2 to gp3 volumes.
gp2 volumes link IOPS to volume size: you get 3 IOPS per GB, with a baseline of 100 IOPS (at 33.33 GB) and a maximum of 16,000 IOPS (at 5,334 GB). To get more IOPS, you must increase volume size, paying for storage you may not need.
gp3 volumes decouple IOPS from volume size. Every gp3 volume provides a baseline of 3,000 IOPS and 125 MiB/s throughput regardless of size. You can provision additional IOPS (up to 16,000) and throughput (up to 1,000 MiB/s) independently and pay only for what you provision beyond the baseline.
For a 100 GB volume needing 3,000 IOPS: with gp2, you would need a 1,000 GB volume (3 IOPS/GB x 1,000 GB = 3,000 IOPS). With gp3, a 100 GB volume already provides 3,000 IOPS at baseline. The gp3 volume costs significantly less because you are not paying for 900 GB of unused storage.
💡 Exam Trap: gp3 is almost always cheaper than gp2 for the same performance. When the exam describes a scenario with gp2 volumes and asks how to reduce cost, migrating to gp3 is usually the correct answer. The migration is online (no downtime) using the Elastic Volumes feature.
aws ec2 modify-volume \
--volume-id vol-0123456789abcdef0 \
--volume-type gp3 \
--iops 3000 \
--throughput 125
Eliminating unattached EBS volumes: When you terminate an EC2 instance, attached EBS volumes may persist (depending on the DeleteOnTermination flag). These orphaned volumes continue to generate charges. Use AWS Config rules or scripts to identify and delete volumes with a state of available (not attached to any instance).
EBS Snapshots are incremental and stored in S3 behind the scenes, but each snapshot is billed based on the amount of changed data since the last snapshot. Old snapshots that are no longer needed should be deleted. The EBS Snapshots Archive tier provides a lower-cost option for snapshots you need to retain but rarely restore.
EFS and FSx Cost Optimization
Amazon EFS offers two storage classes: EFS Standard and EFS Infrequent Access (EFS IA). EFS Lifecycle Management can automatically move files not accessed for a configurable period (7, 14, 30, 60, or 90 days) to the IA class, reducing storage costs by up to 92%. EFS also offers an Intelligent-Tiering policy that moves files back to Standard when accessed. EFS One Zone storage classes cut costs further by storing data in a single AZ, suitable for development workloads or data that can be recreated.
Amazon FSx for Lustre offers both scratch and persistent file systems. Scratch file systems are cheaper because data is not replicated and is lost if the file system fails. They are suitable for temporary processing of data from S3.
To transition smoothly into compute cost optimization, remember that storage and compute costs are interconnected: choosing the right storage tier often reduces compute wait times, and right-sizing compute directly affects how much storage throughput you need to provision.
