Featured image of post GCP #4: Storage

GCP #4: Storage

Explore the fundamentals of Google Cloud Storage, including how buckets store objects and the different storage classes suited for various access patterns.

Explore the fundamentals of Google Cloud Storage, including how buckets store objects and the different storage classes suited for various access patterns.

Storage

Cloud storage is non-structured data storage. If your data is structured then you should look for other storage options. Cloud storage is object-based or blob-based storage.

Available storage classes are:

  1. Multi-regional - Part of Standard now
  2. Regional - Part of Standard now
  3. Nearline
  4. Coldline
  5. Archive

Command

create

  1. list bucket
1
2
3
4
# using gsutil
gsutil ls 
# using gcloud
gcloud storage ls
  1. detail bucket

you can check the detail - like storage class or location - of the bucket using the following commands

1
2
3
4
5
6
# show list with detail
gsutil ls -L 
gcloud storage buckets list
#  show single bucket with detail
gsutil ls -L -b gs://[BUCKET_NAME] 
gcloud storage buckets list gs://[BUCKET_NAME]
  1. create bucket
1
2
3
4
# gsutil
gsutil mb -l [LOCATION] -c [STORAGE_CLASS] gs://[BUCKET_NAME]
# gcloud
gcloud storage buckets create gs://[BUCKET_NAME] -l [LOCATION] -s [STORAGE_CLASS]

the -l flag is for location. In gcloud command the flag can be replaced with --location. the flag -s or -c is for storage class e.g. standard, nearline, coldline or archive.

  1. remove bucket

  2. copy/move bucket

Licensed under CC BY-NC-SA 4.0
comments powered by Disqus