Uncovering the Details of Google Cloud Storage Retention Policy

Google Cloud Storage is an object storage service created by Google Cloud. It allows you to store and keep near-unlimited data or information for a low cost per GB. This service uses several up-to-date methods such as the Google Cloud Storage API or the Console. 

What is Google Cloud Storage Retention Policy

A retention policy, sometimes also called a schedule, is an essential part of the lifecycle of a record. It shows how long a business needs to keep its information or record stored and how to keep control over the record when it's time. 

Trying to place a retention policy on a bucket? You need to know that all present and future objects in the bucket are not allowed to be deleted or replaced until they reach the expiration day you have mentioned in the retention policy.

If you try to delete or replace objects before the expiration period it will fail with a 403 - retentionPolicyNotMet error.

Understanding Object Lifecycle Management?

If you want to use Object Lifecycle Management you should first assure that the defined lifestyle configuration is set up on a bucket.

This configuration consists of a certain set of rules that refer to current and future objects included in the bucket. At the moment when the criteria of one of those rules meet an object, Cloud Storage starts to automatically perform on the object. 

Each of these rules in object lifecycle management includes an action and 1-2 conditions. Let’s see what the lifecycle configuration looks like.

  • Any object is supposed to suit all of the conditions mentioned in a rule for the action to be taken.

  • If you mention multiple rules that include the same action, the action will be taken on an object when that object meets the conditions in any of the specified rules.

  • If the mentioned multiple rules have their specific conditions that are simultaneously satisfied by a single object, Google Storage takes action only on one of the rules based on several circumstances. 

Retention Periods and Retention Policies

The retention periods and retention policies provide the schedule that shows what data should be stored or archived, where the action should be taken, and for how long.

When the retention time period expires for a particular data set, it can be archived in the secondary storage or deleted. This mostly depends on the requirements.

  • The information or data can be retained until your Google Account is deleted. 

  • However, an organization or a company should retain information or data only for as long as it's needed. Retaining data longer than it’s needed takes up more storage space and therefore costs more.

  • The retention policy allows you to define when to delete a piece of data allowing it to simplify the process of data privacy and security operations.

Making Use of Object Lifecycle Management

You can use Object Lifecycle Management to manage Object Storage and Archive Storage data/information. It allows you to reduce the current storage cost as well as keep control over the time you spend on data management. 

Based on the rules you define, Object Lifecycle Management takes automated actions. 

These rules give commands to the Object Storage to remove or replace certain  uploads, resources, objects, object versions, and uncommitted or failed multipart uploads on your behalf within the created bucket and expiration day. Each Object or Archive Storage can contain up to 1,000 rules. 

Utilizing Object Versioning

Object versioning is designed to provide data protection that works against accidental or object updates, deletion, or overwriting.

It directs Object Storage to automatically create an object version for each uploaded, existing, deleted, or overwritten object. Depending on your requirements you can enable object versioning while creating bucket time after that. 

It’s important to note that the pricing of Standard Oracle Cloud Infrastructure refers to each bucket that undergoes versioning. 

This means you will be charged for all the latest, previous, and deleted object versions stored in the bucket. Object versioning increases storage costs and you can use the Object Lifecycle Management tool. 

A versioning-enabled bucket may have many versions of an object. It always includes one latest version of the object and zero or more previous versions. Previous object versions are retained until you decide to delete them.

  1. 1

    First, you need to make sure you have enough permission to view and update buckets in your Google Cloud Storage.

  2. 2

    Then, check if the Object Versioning is disabled for the bucket. Follow the instructions for using Object Versioning and see how to check whether Object Versioning is disabled for a bucket.

Using Object Lock

Object Lock is created to help block objects from being deleted. It also helps to prevent objects from being overwritten for a certain period of time or indefinitely.

Using the Object Lock feature you meet regulatory demands that ask for WORM storage. You can simply add another layer of defense against object changes and deletion.

How to Use Object Lock?

  1. 1

    Go to the Bucket’s page and click on the name of the bucket you need to lock the retention policy for.

  2. 2

    On the top of the page select the Protection tab.

  3. 3

    Click the Lock button on the retention Policy section.

  4. 4

    Read the Permanent part. 

  5. 5

    Type the name of the bucket in the Bucket Name box.

  6. 6

    Click Lock policy. 

Setting Object Expiration

Setting object expiration requires several steps. Let’s discuss them and see how you can set an object expiration date.

  1. 1

    Go to the Bucket section. There you’ll see bucket details. 

  2. 2

    Click on Lifecycle and click on Add Rule.

  3. 3

    Then Select an Action according to your requirements. 

  4. 4

    Click on Continue.

  5. 5

    Select Object Conditions.

  6. 6

    Type the object name on the Object Name box.

  7. 7

    Set Conditions.

  8. 8

    Click on Continue.

  9. 9

    Then click on Create after which you can Add or Edit a Rule.

  10. 10

    It may take up to 24 hours to take effect. So, you need to wait for 24 hours, after which you can check the Object Lifecycle Management. 


Google Cloud Storage Retention Policy is one of the best features on this cloud to use. This service helps you to reduce the amount of data stored. It makes it easier and quicker for you to manage and move from one cloud to another. 

Many companies and businesses tend to keep their data in the cloud indefinitely because they know it’s affordable and safe.

On the other hand, it’s important to take some time to delete older data on the Storage to reduce the cost of the service. 

This is actually part of a data retention plan. There are several factors like data compliance and privacy, cloud governance, and cloud migration that may force you to delete data on a regular basis. 

About the author


Youssef is a Senior Cloud Consultant & Founder of ITCertificate.org

Leave a Reply

Your email address will not be published. Required fields are marked

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Related posts