Data Retention and Data Lifecycle Management
Cloud Storage Lifecycle Policy Implementation
Object Lifecycle Management (OLM) is a tool that automatically manages data stored in Cloud Storage buckets. Administrators create rules that trigger actions when specific conditions are met, such as when objects reach a certain age or match certain prefixes. This automation reduces manual work and prevents mistakes when managing millions of files across a cloud environment.
OLM rules respond to conditions like Age, Versioning state, and Prefix matches. When an object meets a condition, the system can either Delete it permanently or SetStorageClass to move it to a cheaper storage tier. The main storage classes are Nearline, Coldline, and Archive, each designed for data accessed less frequently. Autoclass is an option that automatically moves data between storage classes based on actual usage patterns.
For large-scale deletion of over 100,000 objects, setting a lifecycle rule with an age of zero days is more efficient than using manual commands. Cloud Storage performs the deletion asynchronously in the background, which is faster and more reliable than sending individual delete requests. Soft Delete adds protection by keeping deleted objects in a staging area for a recovery period, while Object Lock prevents objects from being deleted or overwritten to meet compliance requirements.
Compliance and Retention Governance
Sensitive Data Protection (formerly DLP) identifies and protects private information within Google Cloud. Organizations use this service to scan data for sensitive elements like names, phone numbers, or financial information. Architects use these tools to ensure storage practices meet regulatory compliance standards.
A DLP Job inspects specific files in Cloud Storage and can scan all data or just a sample to estimate findings while controlling costs. Each job uses InfoTypes to define what categories of sensitive data to look for, such as "PERSON_NAME" or "CREDIT_CARD_NUMBER". After scanning, Actions determine what happens next, like publishing results to Pub/Sub for further processing.
The Storage Transfer Service moves data securely between storage systems and supports federated identity for authentication without managing long-term credentials. Integration with Secret Manager ensures that sensitive keys and tokens are handled according to security best practices. Together, these tools help architects build a comprehensive strategy for data retention that meets Write-Once-Read-Many (WORM) requirements and manages legal holds to prevent accidental or malicious deletion of regulated data.
Analytical and Database Data Expiration Strategies
BigQuery manages large datasets through partition expiration, automatically deleting old data based on a set schedule to optimize storage costs. Tables not edited for 90 days automatically move to long-term storage, reducing costs by 50% without losing query performance. Table Snapshots create read-only copies that preserve data state indefinitely, useful for audit trails or historical analysis.
For managed databases like Cloud SQL, backup retention windows determine how long backups are kept for disaster recovery. These windows enable point-in-time recovery, allowing restoration to a specific second. Retaining backups even after deleting an instance provides protection against accidental data loss. Transaction logs record every change, enabling precise recovery, while retention locks prevent backups from being deleted before their scheduled time.
Bigtable and Spanner use incremental backups that only store changes since the last backup, saving significant storage space. Spanner supports point-in-time recovery for up to seven days to fix accidental corruption. Setting expiration dates on backups ensures old data does not accumulate and drive up costs unnecessarily.
When data reaches the end of its life, it enters a soft deletion phase with a 30-day recovery window. After this period, logical deletion marks the space as available to be overwritten. Some services use cryptographic erasure, making data unreadable by deleting its encryption keys rather than the data itself.