Lesson 1 of 3 Storage, Data Transfer and Database Optimization

Storage Optimization

Storage grows quietly and rarely shrinks on its own. This lesson explains storage tiers and their trade-offs, lifecycle rules and intelligent tiering, block storage optimization and retention for snapshots and backups.

Learning outcomes

After completing this lesson, you will be able to:

  • Compare object storage tiers and their trade-offs.
  • Distinguish lifecycle rules from intelligent tiering.
  • Identify when tiering costs more than it saves.
  • Describe block storage optimization.
  • Explain retention policies for snapshots and backups.

Why storage needs active management

Compute cost stops when a resource is turned off; storage cost continues until the data is deleted. Data accumulates through logs, backups, analytics outputs, user uploads and copies made for testing, and nobody notices a small monthly increase until storage becomes one of the largest lines on the bill. Storage optimization therefore combines choosing the right type and tier with deciding how long data should be kept.

Object storage tiers

Object storage services offer several storage classes or tiers. Moving from hot to cold tiers lowers the price of storing each gigabyte but raises the price of accessing it. The following comparison summarizes the typical trade-offs; names differ by provider.

Standard (hot)
Storage price per GBHighest
Retrieval chargeNone
Retrieval timeMilliseconds
Minimum storage durationNone
Choose when Data read frequently
Infrequent access (cool)
Storage price per GBLower
Retrieval chargePer GB retrieved
Retrieval timeMilliseconds
Minimum storage durationTypically about 30 days
Choose when Data read occasionally, such as monthly
Archive (cold)
Storage price per GBLowest
Retrieval chargePer GB retrieved, sometimes high
Retrieval timeMinutes to hours for the deepest tiers
Minimum storage durationTypically 90 to 180 days
Choose when Data kept for compliance and rarely, if ever, read

Examples include Amazon S3 Standard, Standard-IA and Glacier classes; Azure Blob Storage hot, cool, cold and archive tiers; and Google Cloud Storage Standard, Nearline, Coldline and Archive classes.

Lifecycle rules and intelligent tiering

Lifecycle rules move or delete objects automatically based on their age, for example moving logs to an infrequent access tier after 30 days, to archive after 90 days and deleting them after seven years. They suit data whose access pattern is predictable from its age.

Intelligent tiering, offered by some providers, monitors each object's access and moves it between tiers automatically, for a small monitoring fee per object. It suits data whose access is unpredictable. For very small objects the monitoring and transition fees can outweigh the saving, which is why some services exclude objects below a minimum size.

The following diagram shows a lifecycle rule and its effect on cost.

A lifecycle rule for data that is read only when new, such as logs. Objects stay in a standard tier while they are read, then move to an archive tier that costs a fraction as much per gigabyte. Transition charges are per object, so they stay small when data is written as large objects.
Rates are examples; check current pricing.

When tiering costs more than it saves

Tiering is not free. Each transition is a request with a charge, so moving millions of small objects can cost more than a year of the storage saving. Data that is read more often than expected incurs retrieval charges that can exceed the storage saving. Deleting data before the minimum storage duration incurs an early deletion charge. Engineers should model transitions and retrievals before applying a rule to a large dataset.

Sort into groups

Will tiering save money?

Exam skills 7.2.1

Decide whether moving data to an infrequent access or archive tier is likely to save money.

Log in to try this activity Interactive activities are free with an account.

Block storage

Block storage volumes are charged for their provisioned size and, for some types, provisioned performance (IOPS and throughput), whether or not it is used. Optimization means choosing the volume type that meets the workload's performance needs at the lowest price, often a newer general-purpose type with independently configurable performance, reducing provisioned performance that is never used, avoiding oversized volumes, and deleting unattached volumes.

Snapshots, backups and retention

Snapshots and backups protect data but accumulate quickly. A retention policy aligned with recovery requirements, for example daily backups for 35 days and monthly backups for a year, enforced by a backup service or automation, prevents years of unneeded copies. Incremental snapshots store only changed blocks, but deleting old ones does not always free as much as expected because later snapshots may reference their blocks.

True or false

Snapshot savings

Exam skills 7.2.1

Check how snapshot and backup savings behave.

Log in to try this activity Interactive activities are free with an account.
Worked example

A lifecycle rule for logs

An application writes 20 TB of logs a month to standard object storage at USD 0.023 per GB-month. Logs are read during the first week and almost never after 30 days, and must be kept for one year. An archive tier costs USD 0.004 per GB-month. Roughly how much does moving logs older than 30 days to archive save once the year's data has accumulated?

After a year, about 240 TB are stored, of which about 220 TB are older than 30 days. In standard storage they cost about 220,000 x 0.023 = USD 5,060 a month; in archive, about 220,000 x 0.004 = USD 880. The saving is about USD 4,180 a month, less transition charges, which are small if logs are written as large objects. Writing logs as many tiny objects would make transitions far more expensive, so batching logs into larger files is part of the design.

Worked example

Tiering that backfired

A team moved a 50 TB dataset to an infrequent access tier to save storage cost. The next month's bill for the bucket rose. What probably happened?

The data is read more often than assumed, for example by a nightly analytics job that scans it. Retrieval charges per gigabyte read in the infrequent access tier exceeded the storage saving. The team should check access logs or request metrics, move frequently read data back to the standard tier or use intelligent tiering, and model access patterns before tiering in future.

Check yourself

Why can moving frequently read data to an infrequent access tier increase cost?

Show answer

Infrequent access tiers charge per gigabyte retrieved. If data is read often, retrieval charges can exceed the storage saving.

Exam Tips

Remember for the exam

  • Colder tiers store cheaply but charge for retrieval and have minimum storage durations.
  • Lifecycle rules suit age-based access; intelligent tiering suits unpredictable access.
  • Model transition and retrieval charges, especially for small or frequently read objects.
  • Set retention policies for snapshots and backups and delete unattached volumes.