Cloud concept · Updated

Data Retention - Data retention is the practice of defining and enforcing how long data is kept, how it remains usable, and when it can be deleted.

In short

Retention policies balance business needs, recovery requirements, legal obligations, privacy, and storage cost. In the cloud, engineers implement them through lifecycle rules, backup schedules, retention periods, deletion controls, and exceptions such as legal holds.

Cloud Concepts Hub →

6 key aspects of Data Retention

Effective retention combines explicit time limits, automated lifecycle actions, protected preservation, recoverable backups, and verified handling of every relevant copy.

01
Purpose-based retention periods

Assign retention periods by data category, business purpose, and applicable obligations. Define the event that starts the clock, such as creation, transaction completion, or account closure.

02
Automated lifecycle actions

Use supported lifecycle rules to transition or expire data without relying on manual cleanup. Verify whether a rule changes storage class, deletes data, or only affects its current version.

03
Enforced preservation and legal holds

Use immutable retention controls when data must survive accidental or malicious deletion. Treat legal holds as exceptions to normal disposal and tightly control permissions to remove or bypass protection.

04
Independent backup retention

Specify backup frequency and recovery-point retention separately from production-data retention. Test restoration and confirm that retained backups meet recovery objectives.

05
Coverage of versions and copies

Account for noncurrent versions, replicas, exports, and backups when implementing retention and deletion requirements. Removing a production record does not automatically remove every retained copy.

06
Cost, accessibility, and evidence

Balance lower storage cost against retrieval latency and charges while preserving required access and encryption keys. Monitor enforcement and keep evidence of policy changes, backup results, and disposal outcomes.

Cloud services for Data Retention

These services implement complementary parts of a retention design. Amazon S3 handles object tiering and expiration, while Object Lock preserves protected versions against deletion. AWS Backup manages recovery-point schedules and retention across supported resources, with Vault Lock available for stronger deletion protection. Amazon EFS Lifecycle management reduces the cost of retaining less frequently accessed files without deleting them. Supported persistent Amazon FSx for Lustre file systems provide scheduled backups with defined retention. Engineers must coordinate these controls so that live data, object versions, and backups follow approved policies without confusing cheaper storage with disposal or immutability with recoverability.

Amazon S3Amazon S3

S3 Lifecycle automates supported storage-class transitions and expiration, including separately configured handling of noncurrent versions. S3 Object Lock adds version-level retention and legal holds when deletion must be prevented.

AWS BackupAWS Backup

AWS Backup centralizes backup schedules and recovery-point retention for supported resources. Backup Vault Lock can enforce retention constraints and protect backups from premature deletion; its governance and compliance modes provide different bypass protections.

Data Retention exam questions

Real practice exam questions on Data Retention, with the correct answer and its explanation. Answer them with every option in the exam simulator.

AIF-C01

A company stores large AI model evaluation reports in a nonversioned Amazon S3 bucket. Its governance policy requires the reports to remain available for two years and then become eligible for automatic deletion. Auditors must be able to retrieve any report immediately throughout the retention period, although reports are rarely accessed after the first month. No legal holds apply. Which solution meets these requirements while reducing storage costs for older reports?

Show answerCORRECT ANSWER

Use S3 Lifecycle to transition reports to S3 Standard-IA after one month and expire them after two years.

S3 Standard-IA provides immediate access for infrequently accessed reports at a lower storage cost than S3 Standard. The lifecycle expiration action separately makes reports eligible for automatic deletion after the approved retention period.

DEA-C01

A company stores temporary analytics results in an Amazon S3 bucket that has never had versioning enabled. An enabled S3 Lifecycle rule expires objects in the results/ prefix 30 days after creation.

The company changes its retention policy: results must remain available for 90 days after creation and then become eligible for automatic deletion. All existing results are less than 20 days old. An administrator adds a bucket policy that explicitly denies s3:DeleteObject to all principals for results/*, expecting this policy to prevent premature Lifecycle deletion. No Object Lock protections or other deletion processes apply.

Which change must a data engineer make to meet the revised retention policy with the least operational overhead?

Show answerCORRECT ANSWER

Change the existing Lifecycle rule's expiration age from 30 days to 90 days.

Updating the expiration action makes existing and future matching objects eligible for automatic deletion after 90 days from creation. All existing objects are younger than the original expiration threshold. The bucket policy's explicit deny does not block S3 Lifecycle expiration.

SAP-C03

A healthcare software company stores application recovery packages in an existing Amazon S3 general purpose bucket that has never had S3 Versioning enabled. The application replaces each package by issuing a PUT request to the same object key. Changing the bucket name, object keys, or upload behavior would require a lengthy application release.

Beginning at a planned cutover, every successfully uploaded package must remain recoverable for at least 60 days after its upload, even if ransomware subsequently uploads corrupted content to the same key. No identity, including the AWS account root user, may permanently delete a protected package or shorten its established retention. Operators must be able to make a retained package the current package again without changing the key used by readers. Packages that exist before cutover do not require retention protection.

Which solution meets these requirements?

Show answerCORRECT ANSWER

Enable S3 Versioning and S3 Object Lock on the existing bucket before cutover. Configure default 60-day compliance-mode retention, and ensure uploads cannot specify shorter retention. Keep versioning enabled. Recover a package by copying its retained version to the same key, creating a new current version.

Object Lock can be enabled on an existing general purpose bucket and requires Versioning. Compliance-mode retention prevents permanent deletion or shortening of an established retention period, including by the root user. Protection applies to individual versions: a PUT to the same key creates another version without modifying the retained version. Copying a retained version back to the same key creates a new current version. After Object Lock is enabled, it cannot be disabled and versioning cannot be suspended.

Practice Data Retention in a full exam

Questions on Data Retention in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Data Retention

3 min read

Data retention answers three practical questions: which data must be kept, how long it must be kept, and what happens when that period ends. A policy should identify the data owner, the reason for retention, the event that starts the retention clock, and any exceptions. For example, operational logs might be retained for 90 days, while financial records might need several years of retention under applicable requirements. These periods are organizational decisions, not universal cloud defaults.

Retention has both minimum and maximum boundaries. A minimum period prevents premature destruction of required evidence or recovery data. A maximum period limits unnecessary storage, privacy exposure, and the impact of a security incident. Keeping everything forever is not automatically safer: it increases cost and can conflict with data minimization or deletion obligations. Legal holds can suspend normal disposal, so deletion workflows must account for them.

Cloud lifecycle policies automate actions based on conditions such as object age, tags, or access patterns. Moving data to a cheaper storage tier changes its storage characteristics, not necessarily its retention period. For example, an application could retain logs in readily accessible storage initially, transition older logs to archival storage, and expire them after the approved retention period. Engineers must consider retrieval latency, retrieval charges, minimum storage duration charges, and transition eligibility before choosing tiers.

Amazon S3 Lifecycle can transition objects between supported storage classes and expire objects. In a versioned bucket, expiration of a current object generally creates a delete marker rather than permanently removing its previous versions. Noncurrent-version expiration requires separate configuration. Rules must therefore address the relevant versions and copies; hiding an object from normal reads does not prove that its data has been deleted.

Retention enforcement differs from automated cleanup. S3 Object Lock protects individual object versions using retention periods or legal holds. Governance mode permits authorized bypass, whereas compliance mode prevents deletion or shortening of the retention period even by the account root user during that period. A legal hold has no automatic expiration and remains until removed by an authorized principal. Object Lock requires versioning, and lifecycle expiration cannot permanently delete a protected version while its protection remains active.

Backups have their own retention requirements. AWS Backup provides centralized scheduling and retention management for supported resources, helping preserve recovery points after production data changes or is deleted. Backup frequency determines how much recent work might be lost; backup retention determines how far back recovery can reach. Neither a successful backup job nor a long retention period proves that restoration will meet operational requirements, so recovery testing remains necessary. AWS Backup Vault Lock can enforce retention constraints and protect recovery points against premature deletion, depending on its configuration and mode.

File storage illustrates another important distinction. Amazon EFS Lifecycle management moves eligible files among storage classes according to access patterns; it does not provide age-based automatic file deletion. Amazon FSx for Lustre supports automatic backup scheduling and retention for supported persistent file systems, while scratch file systems do not support backups. File disposal and backup expiration therefore require separate design decisions.

A complete implementation covers production data, replicas, exports, object versions, and recovery points. Retained encrypted data also requires usable encryption keys and appropriate access permissions throughout the retention period. Monitor policy changes, failed backups, and deletion outcomes, and document how exceptions are approved. For exam questions, distinguish tiering for cost, expiration for disposal, backups for recovery, and immutable retention for protection against deletion.

Learn Data Retention in lessons

19 short lessons on Data Retention in 8 certification courses.

and 13 more lessons

Open the lessons