Object Versioning in Google Cloud Storage

Lab Details:

  • This lab walks you through Object Versioning for Cloud Storage Bucket.

  • You will be protecting your data by enabling Object versioning to prevent data loss.

  • Region: Multi-region

  • Duration: 30 minutes

What is Object Versioning?

  1. Object versioning prevents accidental deletion and also provides the history of what happens with the specific object in the bucket.

  2. Object versioning is best for data recovery processes and it can be enabled at Bucket level and it can be turned on/off at any time.

  3. Whenever you use object versioning, the latest version of the object which you have uploaded will be the live version. 

  4. Therefore, Live versions and non-current versions are stored in the same bucket with the same storage class by default.

  5. According to Google recommended practices, you need to use Object versioning in Cloud Storage for sensitive data.

Why do we need Object Versioning?

  1. If you have an object and if somebody mistakenly deleted it, then you will lose the object. So, if you have turned on the object versioning for a bucket even if the object is accidentally deleted you can restore it from the previous version.

  2. By enabling object versioning, if you delete/replace a live object in the bucket then it becomes a non-current object version. So, you can restore the deleted object by using the non-current version number.

  3. Older versions are uniquely identified by object key + generation number. By using this identifier you access the older version to perform any actions.

  4. To list current and non-current object versions in CLI. Enter the below command:

    gsutil ls -a gs://<bucket_name>

Lab Tasks:

  1. Login into GCP Console.

  2. Creating a bucket in Cloud Storage

  3. Enabling Object versioning at the bucket level

  4. Uploading the objects into your bucket.

  5. Deleting one of the objects in the bucket

  6. Ensuring the availability of the deleted objects in CloudShell as well as Cloud Console

Join Whizlabs_Hands-On to Read the Rest of this Lab..and More!

Step 1 : Login to My-Account
Step 2 : Click on "Access Now" to view the course you have purchased
Step 3 : You will be taken to our Learn Management Solution (LMS) to access your Labs,Quiz and Video courses

Open Console