Latticework

Command Palette

Search for a command to run...

GCP Concepts

GCS Storage Classes

16 min

Explanation

Cloud object storage (GCS, and S3's equivalent tiers) offers several storage classes trading storage cost against retrieval cost, based on how often data is expected to be accessed: Standard (frequent access, higher storage cost, cheap/free retrieval), Nearline, Coldline, and Archive (progressively colder — cheaper to store, more expensive and slower to retrieve). Picking the wrong class either wastes money on unnecessary standard-tier storage, or racks up retrieval fees on data that's actually accessed often.

def recommend_storage_class(accesses_per_year):
    if accesses_per_year >= 12:
        return "standard"
    elif accesses_per_year >= 4:
        return "nearline"
    elif accesses_per_year >= 1:
        return "coldline"
    else:
        return "archive"
Try it

This mirrors Cloud Fundamentals' reserved-vs-on-demand pricing lesson exactly -- both are 'commit to a usage pattern upfront in exchange for a better rate' tradeoffs, just applied to storage access frequency here instead of compute uptime.

Loading editor…
Exercise

Write `recommend_storage_class(accesses_per_year)`: return `'standard'` if `accesses_per_year >= 12`, `'nearline'` if `>= 4`, `'coldline'` if `>= 1`, otherwise `'archive'`.

Quiz

Why would a colder (less frequently accessed) storage class cost LESS per GB to store but MORE per GB to retrieve?

Checkpoint

You can recommend the right storage class based on expected access frequency, and understand why colder tiers trade cheaper storage for more expensive retrieval.