Google Cloud Storage:
- Google Cloud Storage is a RESTful online file storage webservice for storing and accessing data on Google Cloud Platform infrastructure.
- It is an Infrastructure as a Service (IaaS)
Features Of Cloud Storage:
· Cloud Storage is unified object storage service.
· Cloud Storage is a persistent storage, it is durable, replicated and made globally available via HTTP URL.
· Cloud Storage is auto scalable service.
· Cloud Storage is not a File System, because each item in cloud storage have unique URL.
· Cloud Storage objects are immutable.
· Cloud Storage allow to version the stored objects.
· Object Versioning needs to be enable explicitly, in absence of
· Object Versioning, new objects terminates the old.
· Cloud Storage offers life cycle management policy for the objects in bucket.
Key Terms:
➤ Buckets: Basic containers that hold your data. Everything that you store in Google Cloud Storage must be contained in a bucket. You can use buckets to organize your data and control access to your data, but unlike directories and folders, you cannot nest buckets.
➤ Bucket names: Should be unique as the name of the buckets stored in single Cloud Storage namespace. Also, bucket names can be used with a CNAME redirect, which means they need to conform to DNS naming conventions.
➤ Bucket labels: Bucket labels are key : value metadata pairs that allow you to group your buckets along with other Google Cloud.
· Objects: Objects are the individual pieces of data that you store in Google Cloud Storage.
· Objects have two components: object data and object metadata.
· The object data component is usually a file that you want to store in Google Cloud Storage.
· The object metadata component is a collection of name-value pairs that describe various object qualities.
· There is no limit on the number of objects that you can create in a bucket.
· Cloud Storage objects are immutable.
· Cloud Storage allow to version the stored objects.
· Object Versioning needs to be enabled explicitly, in absence of Object Versioning, new objects terminates the old.
· Cloud Storage offers life cycle management policy for the objects in bucket.
What kind of storage is used for what use case?
1. Block storage for GCP VMs – Persistent Disk
2. Immutable blobs – Cloud Storage
3. RDBMS – CloudSQl & CloudSpanner
4. NoSQL Database (json, mongo dB) – Datastore
5. NoSQL key-value dB – Bigtable
6. Import data in cloud – transfer service
Working with Google Cloud Storage Buckets Using console:
o GCP organizes resources into projects. This allows you to collect all of the related resources for a single application in one place. Go to navigation menu.
o Storage browser page opens.
o If you have created any bucket in past, it will be displayed here otherwise it will be empty as shown.
o Click on Create bucket option, to create a new storage in GCS.
o Name your bucket: Bucket names must be globally unique (among all buckets ever created by any user).
o Choose where to store the data: Select the Location Type for your data.
§ The default, Multi-region, delivers the highest availability.
§ For lower latency, you may wish to choose Regional.
§ Choosing Dual-region strikes a balance between them.
o Choose a default storage class for your data: Select a default storage class for data in this bucket. The default is Standard, but you may wish to choose a different option based on your needs. This decision should be based around how long you plan to store your data and how often it will be accessed.
o Choose how to control access to objects: Specify how to control access to objects, whether you want to control access at the bucket level only (Uniform), or to also enable individual stored objects to have additional permission settings (Fine-grained). https://cloud.google.com/storage/docs/uniform-bucket-level-access
§ There are some optional settings for Encryption, Retention policy, and Labels that you may set. (while creating I have entered retention policy as 1 days so after a day my data will be removed)
o Click on create button to create the storage. You can find bucket “demo01-bucket” created as follow.
Upload data via the Console:
· Click on the storage name (i.e., demo01-bucket ). You can view the below page opening up.
· Click on upload files/ upload folder or create a folder then upload files or folder according to the requirement. I have uploaded a simple json file into my bucket.
· You can find a job running as shown below.
· By clicking on name of storage file created. You can view file size, type of file, created date, and details about storage class. By default, public access will be not available to public.
· If you want to change it from not public to available to public, you can use edit permissions
· If you want to delete the data, just click on the storage and delete it as shown.
You can refer how to create google cloud storage bucket using CLI in this post.
Happy Learning!!!