Google Cloud Storage

Abhishek Kumar
7 min readAug 5, 2023

--

  1. Introduction
  2. Explanation of Google Cloud Hierachy
  3. Storage options/Class
  4. Storage class pricing
  5. Object Versioning
  6. Object Lifecycle Management
  7. Data encryption in Cloud Storage
  8. Basic tool for Cloud storage
  9. Use case and Deployment Scope
  10. Connect With me

Introduction

Cloud Storage is a global, secure and scalable object store for immutable data such as images, text, videos or any other file formats. It store the data into Bucket a which is asssociated with project ,which is grouped under Organisation. We can uplode the object and dowunlode the object using gsutil or console.

The Google Cloud Hierachy

  • Organization: Your company Name.
  • Project: Example -building several applications, and each one is associated with a project. Each project has its own set of Cloud Storage APIs, as well as other resources.
  • Bucket: Each project can contain multiple buckets, which are containers to store your objects. For example, you might create a photo bucket for all the image files your app generates and a separate video bucket.
  • Object : An individual file, such as an image called abhishek.png .

Buckets

Buckets are the same as basic containers that hold/store your data. Anything that you store in Cloud Storage must be contained in a bucket. You can use buckets to organize your data and control access to your data.

No limit to the number of buckets you can have in a project or location but You cannot change the name or location of an existing bucket. If you want to change ,create a new and delete existing bucket.

Bucket names

  • Every bucket name must be globally unique.
  • Bucket names can only contain lowercase letters, numeric characters, dashes (-), underscores (_), and dots (.). Spaces are not allowed.
  • Names cannot contain “google” or close misspellings, such as “g00gle”.
  • Names must start and end with a number or letter.
  • Names must contain 3–63 characters. Names containing dots can contain up to 222 characters, but each dot-separated component can be no longer than 63 characters.
Bucket Name

Location type

Regional:- A region is a specific geographic place.

  • Lowest storage price
  • No replication charges

Dual-region:- A dual-region is a specific pair of regions.

  • Highest storage price.
  • Replication charges apply on write.

Multi-region:- A multi-region is a large geographic area, such as the United States, that contains two or more geographic places.

  • Higher storage price than regional, but lower than dual-region.
  • Replication charges apply on write
Location to store the data

Storage options/Class

A storage class sets costs for storage, retrieval and operations, with minimal differences in uptime. Choose if you want objects to be managed automatically or specify a default storage class based on how long you plan to store your data and your workload or use case.

  1. Autoclass:- Object automatically transitions hotter or colder storage based on object-level activity, to optimise for cost and latency.
  2. Default class:- Defult class is pplies to all objects in your bucket unless you manually modify the class per object or set object lifecycle rules. Best when your usage is highly predictable.

Note:- Can’t be changed to Autoclass once the bucket is created.

Default class Storage.

  1. Standard storage:- Best for short-term storage and frequently accessed data.
  2. Nearline storage:- Best for backups and data accessed less than once a month.
  3. Coldline Storage:-Best for disaster recovery and data accessed less than once a quarter.
  4. Archival storage:- Best for long-term digital preservation of data accessed less than once a year.
Credit :-Google

Storage class pricing

Cloud storage service pricing is based on 4 components which are:

  1. Data Storage: It counts to the amount of data stored in your buckets. Storage rates vary depending on the storage class of the data and the location of your buckets.
  2. Network Usage: The amount of data read from or moved between the buckets.
  3. Operations Usage: The actions taken in Cloud Storage, such as listing the objects in the buckets, etc.
  4. Retrieval and early deletion fees: It is applicable for data stored in the Nearline Storage, Coldline Storage, and Archive Storage classes.

Object Versioning

To support the retrieval of objects that are deleted or replaced, Cloud Storage offers the Object Versioning feature. Cloud Storage retains a noncurrent object version each time you replace or delete a live object version.

You permanently delete versions of objects by including the generation number in the deletion request or by using Object Lifecycle Management.

If you disable Object Versioning:

  • The bucket no longer accumulates new noncurrent versions of objects.
  • Object versions that already exist in the bucket are unaffected.

Note:-Object Versioning cannot be enabled on a bucket that currently has a retention policy.

Object Lifecycle Management

In order to use Object Lifecycle Management, you define a lifecycle configuration, which must be set a bucket. The configuration contains a set of rules which apply to current and future objects in the bucket. When an object meets the criteria of one of the rules, Cloud Storage automatically performs a specified action on the object.

Use cases:

  • Delete objects created .
  • only the 3 most recent versions of each object in a bucket with versioning enabled.
  • The storage class of objects older than 365 days to Coldline storage.

Lifecycle actions

A lifecycle rule specifies exactly one of the following actions:.

Delete:- The Delete action deletes an object when the object meets all conditions specified in the lifecycle rule.

Data encryption in Cloud Storage

Cloud Storage always encrypts your data on the server side, before it is written to disk, at no additional charge.

Three ways to encrypt your data when using Cloud Storage.

  1. Customer-managed encryption keys.

If you need more control over key operations than what Google-managed encryption keys allows, you can use customer-managed encryption keys. These keys are created and managed using Cloud Key Management Service (Cloud KMS), and you store the keys as software keys, in an HSM cluster, or externally.

When using a customer-managed encryption key, an object is encrypted with the key by Cloud Storage at the time it’s stored in a bucket, and the object is automatically decrypted by Cloud Storage when the object is served to requesters.

Restrictions:- The Cloud KMS key ring in the same location as the data you intend to encrypt.

Cannot encrypt an object with a customer-managed encryption key by updating the object’s metadata.

2. Use customer-managed encryption keys.

If you provide a customer-supplied encryption key, Cloud Storage does not permanently store your key on Google’s servers or otherwise manage your key.

Restrictions:- We can only set customer-supplied encryption keys on individual objects. You cannot set a default customer-supplied encryption key for a bucket.

  • Cloud Storage Transfer Service and Cloud Dataflow do not currently support objects encrypted with customer-supplied encryption keys.
  • We cannot use the Google Cloud console to download objects that are encrypted with a customer-supplied encryption key

3. Google-managed encryption keys.

Cloud Storage manages server-side encryption keys on your behalf using the same hardened key management systems that we use for our own encrypted data, including strict key access controls and auditing.There is no setup or configuration required, no need to modify the way you access the service, and no visible performance impact. Data is automatically decrypted when read by an authorized user.

Basic tool for Cloud storage

  1. Console: It provides a visual interface for you to manage your data in a browser.
  2. Client libraries: The Cloud Storage client libraries allow you to manage your data using one of your preferred languages, including C++, C#, Go, Java, Node.js, PHP, Python, and Ruby.
  3. REST APIs: It manage our data using the JSON or XML API.
  4. Google Cloud CLI: It allows you to interact with Cloud Storage through a terminal using Google storage command.

Clous Storage Use case and Deployment Scope

  1. Host static content:- Google cloud storage is use to host or deploy the static website. Static content may be in website or Blog .
  2. Backups and archives: It provides fast, low-cost, highly durable storage for data accessed less than once a month. It is perfect for reducing the cost of backups and archives while still retaining immediate access. Backup data in Cloud Storage can be used for more than just recovery because all storage classes have ms latency and are accessed through a single API.
  3. Backup entire systems:- We can store all the backups of the system and can easily store the huge amount of the data.
  4. Media content storage and delivery Share files:- We can Google Cloud Storage for sharing files between users. Google Cloud Storage service provides the availability and throughput needed to stream audio or video directly to apps or websites.
  5. Integrated repository for analytics and ML:- Cloud Storage is also strongly consistent, giving you confidence and accuracy in analytics workloads.

Follws us on social media

Instagram

Linkedin

Linktree

--

--