Cloud Storage Deep Dive: Buckets, Storage Classes, Lifecycle, Versioning, Access Control and Signed URLs
What Is Cloud Storage?
- Object storage for files of any type: images, backups, logs, datasets
- Data is in buckets (globally unique names) as objects with metadata
- 11 nines of annual durability, strong consistency, any size up to 5 TiB per object
- Same API and speed for all storage classes (no slow retrieval like some tape-style archives)
Location Types
| Type | Example | Use |
|---|---|---|
| Region | asia-south1 | Lowest cost, data residency, near compute |
| Dual-region | asia1 or custom pair | High availability with geo-redundancy and a turbo replication option |
| Multi-region | US, EU, ASIA | Content served to many places, highest availability |
Storage Classes
| Class | Minimum storage | Best for | Cost pattern |
|---|---|---|---|
| Standard | None | Hot data, websites, analytics | Highest storage, lowest access |
| Nearline | 30 days | Accessed about once a month (backups) | Cheaper storage, retrieval fee |
| Coldline | 90 days | About once a quarter (disaster recovery) | Cheaper still |
| Archive | 365 days | About once a year (compliance archives) | Cheapest storage, highest retrieval fee |
- Autoclass moves each object between classes automatically by access pattern
- Early deletion before the minimum period is still charged for the minimum
- Pick the class by how often you read, not by how important data is
Create and Use a Bucket
bash
gcloud storage buckets create gs://acme-reports-482 --location=asia-south1 --default-storage-class=STANDARD \
--uniform-bucket-level-access --public-access-prevention
gcloud storage cp report.pdf gs://acme-reports-482/2026/
gcloud storage ls -l gs://acme-reports-482/2026/
gcloud storage rsync ./site gs://acme-reports-482/site --recursive
gcloud storage objects update gs://acme-reports-482/2026/report.pdf --storage-class=NEARLINE
Lifecycle Management
json
{"rule": [
{"action": {"type": "SetStorageClass", "storageClass": "NEARLINE"}, "condition": {"age": 30, "matchesStorageClass": ["STANDARD"]}},
{"action": {"type": "SetStorageClass", "storageClass": "COLDLINE"}, "condition": {"age": 90}},
{"action": {"type": "Delete"}, "condition": {"age": 730}},
{"action": {"type": "Delete"}, "condition": {"numNewerVersions": 5, "isLive": false}}
]}
bash
gcloud storage buckets update gs://acme-reports-482 --lifecycle-file=lifecycle.jso
Protecting Data
| Feature | Purpose |
|---|---|
| Object versioning | Keep old versions to recover from overwrite or delete |
| Soft delete | Recover deleted objects for a retention window |
| Retention policy and bucket lock | Objects cannot be deleted or changed until a date (WORM, compliance) |
| Object holds | Temporary or event-based holds |
| Turbo replication / dual-region | Faster geo-redundancy |
| Cross-bucket replication | Copy to another bucket |
| CMEK | Your own Cloud KMS key |
bash
gcloud storage buckets update gs://acme-reports-482 --versioning
gcloud storage buckets update gs://acme-reports-482 --retention-period=7y
Access Control
- Use IAM with uniform bucket-level access (turn off old ACLs)
- Turn on public access prevention unless the bucket is meant to be public
- Give roles such as
storage.objectViewerto groups or service accounts at the bucket level - Signed URLs give temporary access to one object without a Google account
- Signed policy documents allow controlled browser uploads
bash
gcloud storage sign-url gs://acme-reports-482/2026/report.pdf --duration=1h --impersonate-service-account=signer@my-proj.iam.gserviceaccount.com
Static Website and CDN
- Set
index.htmland404.htmlas the main and not-found pages - For HTTPS and a custom domain, put the bucket behind a load balancer with Cloud CDN as a backend bucket
Events and Integration
- Pub/Sub notifications or Eventarc trigger Cloud Run or functions when objects change
- BigQuery external tables query files in place
- Storage Insights reports on your data
Practice
- Create a bucket with uniform access and public access prevention
- Apply a lifecycle rule that moves to Nearline after 30 days
- Turn on versioning, overwrite a file and restore the old version
- Create a signed URL and open it in a private browser window
Conclusion
Cloud Storage holds objects in regional, dual-region or multi-region buckets. Choose the class by access frequency (or Autoclass), automate with lifecycle rules, protect with versioning and retention, and share safely with IAM and signed URLs.
Quick Summary: what; locations; classes; create; lifecycle; protection; access; website; events.

