Data Store Management · Topic 6 of 7
Data Lifecycle Management
Manage data lifecycles on AWS with S3 storage classes, lifecycle rules, versioning, Object Lock, DynamoDB TTL, Redshift cold data, retention and backups.
- 4 min
- Lifecycle rules transition objects between classes and expire them by age, prefix or tag.
- Intelligent-Tiering suits unknown access patterns.
- Glacier classes are for archive. Deep Archive is the cheapest and slowest.
What it is
Data has a lifecycle. It is hot when new and often read, then cools as it ages, and finally it must be archived or deleted to meet cost goals and legal rules.
Lifecycle management moves data between storage tiers and removes it at the right time, mostly through automatic rules instead of manual work.
How it works
S3 storage classes
| Class | Fit |
|---|---|
| S3 Standard | Frequently accessed data |
| S3 Intelligent-Tiering | Unknown or changing access, moves objects between tiers automatically |
| S3 Standard-IA and One Zone-IA | Infrequent access with fast retrieval, One Zone keeps one Availability Zone only |
| S3 Glacier Instant Retrieval | Archive data that still needs millisecond access |
| S3 Glacier Flexible Retrieval | Archive with retrieval in minutes to hours |
| S3 Glacier Deep Archive | Lowest cost, long term retention, retrieval in hours |
Lower cost classes charge more to retrieve data, and some have a minimum storage duration and a minimum billable object size. Archive classes are poor choices for data that queries read often.
Lifecycle rules
An S3 lifecycle configuration holds rules that apply to a whole bucket, a prefix or objects with a given tag. A rule can transition objects to another class after a number of days, expire (delete) them, expire noncurrent versions and clean up incomplete multipart uploads.
{
"Rules": [{
"ID": "tier-then-expire",
"Status": "Enabled",
"Filter": { "Prefix": "raw/" },
"Transitions": [
{ "Days": 30, "StorageClass": "STANDARD_IA" },
{ "Days": 90, "StorageClass": "GLACIER" }
],
"Expiration": { "Days": 2555 }
}]
}
Apply it with aws s3api put-bucket-lifecycle-configuration --bucket my-bucket --lifecycle-configuration file://lifecycle.json using the AWS CLI. Transitions generally move data to colder classes, not back.
Versioning, replication and protection
Versioning keeps every version of an object, so an overwrite or delete can be undone. Lifecycle rules should expire noncurrent versions or storage grows without limit. MFA delete adds a second factor to permanent deletes.
S3 Object Lock provides write once read many (WORM) protection with retention periods and legal holds, which suits regulatory retention. S3 replication copies objects to another bucket or Region for resilience or compliance, and it needs versioning on both buckets.
Expiring data in other stores
| Store | Lifecycle tool |
|---|---|
| DynamoDB | TTL deletes expired items automatically |
| Redshift | Keep recent data in the cluster, UNLOAD older data to S3, query it through Spectrum |
| Kinesis Data Streams | Retention period of the stream |
| CloudWatch Logs | Retention setting on each log group |
| Athena and Glue | Lifecycle on the underlying S3 data and partitions |
A common warehouse design keeps hot data in Redshift and moves history to S3 in Parquet. Queries can still join the two through Spectrum.
Backup and resilience
AWS Backup centralizes backup plans for Redshift, DynamoDB, RDS, EFS and other services, with schedules, retention and cross Region copies. Redshift takes automated snapshots and supports manual snapshots, and DynamoDB offers on demand backups and point in time recovery.
Use cross Region copies when the requirement mentions disaster recovery. Pick the recovery point objective (RPO) and recovery time objective (RTO) first, since they decide the service and the cost.
Deletion, retention and compliance
A retention policy states how long to keep each kind of data, and a deletion process enforces it. Deleting data that is no longer allowed to exist, for example after a privacy request, may need table formats such as Iceberg to remove rows, and a purge of backups and replicas as well.
Governance rules can pull in two directions. A legal hold can force you to keep data that a lifecycle rule would delete, and Object Lock can block lifecycle expiration until retention ends.
Cost thinking
Match the class to the access pattern. Intelligent-Tiering avoids guessing, but it adds a monitoring charge per object. Many tiny objects can cost more in lower classes because of minimum sizes, so compact them first.
What to remember for the exam
- Lifecycle rules transition objects between classes and expire them by age, prefix or tag.
- Intelligent-Tiering suits unknown access patterns.
- Glacier classes are for archive. Deep Archive is the cheapest and slowest.
- Versioning needs a rule for noncurrent versions, or storage keeps growing.
- Object Lock gives WORM retention. Replication needs versioning on both buckets.
- DynamoDB TTL, log group retention and stream retention handle expiry elsewhere.
- Redshift hot data can stay in the cluster while cold data moves to S3 and is read with Spectrum.
- AWS Backup centralizes backup policy across services.
When the question says "access pattern is unknown or changes", choose S3 Intelligent-Tiering instead of writing lifecycle rules.
Common mistakes
Archiving data that is still queried. Retrieval from Glacier classes is slow or costs more, and it breaks interactive queries.
Forgetting noncurrent versions. Deleting the current object leaves older versions that still cost money.
Expecting lifecycle to override Object Lock. Retention locks win until they expire.
Ignoring minimum sizes and durations. Moving tiny or short lived objects to colder classes can raise the bill.
Expiration is permanent. Test lifecycle rules on a prefix with a copy of the data before applying them to production.
Check yourself
Which S3 class fits data with unknown access patterns?
S3 Intelligent-Tiering.
What does S3 Object Lock provide?
WORM protection with retention periods and legal holds.
How can Redshift keep cost low for old data?
Unload it to S3 in Parquet and query it with Spectrum.
Topic 6 of 7 in Data Store Management
Test yourself on Data Store Management
The full AWS DEA-C01 question bank has 845 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by AWS. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.