Object storage access and lifecycle
Keep objects private and grant specific access
Start with private storage. A bookstore backend can read covers with a workload identity; an ingestion worker can upload to its own prefix; a recovery administrator can restore approved versions. Separate list, read, write and delete permissions rather than granting an entire storage administrator role. S3 IAM and bucket policies plus Block Public Access, Azure Entra data roles and storage-account/container settings, and Google Cloud IAM and public-access prevention are different controls. Network restrictions and data authorization are independent. Encrypt traffic using TLS and use provider-supported encryption at rest and key management. Encryption does not replace authorization or backup.
Delegate one operation for a short time
An authenticated bookstore customer asks the application for a cover download. The application checks that customer access is allowed, then issues a narrowly scoped, short-lived storage URL if the design requires one. AWS presigned URLs, Azure shared access signatures (prefer user delegation SAS when appropriate), and Google Cloud signed URLs can authorize specific operations under different rules. Treat the URL as a bearer secret; avoid logs, analytics, chat or persistent storage containing it. In our offline example a token authorizes GET for covers/b001/front.jpg until minute 10, with validity defined as minute less than 10. A GET for the same object at minute 8 succeeds in the model; PUT at minute 8, GET on another key, and GET at minute 10 do not. Real expiry, revocation, credential lifetime and endpoint behavior need provider-specific verification. Use an authenticated application and new object keys for uploads; validate content and avoid unintended overwrite.
Separate versioning, soft delete and retention
Versioning keeps revisions so an earlier object can sometimes be restored after overwrite or deletion. Soft delete retains a deleted resource for a configured recovery window. Retention policies or legal holds can prevent eligible data from being removed before a specified condition is met. Replication copies data to another location according to service rules; it can also propagate unwanted changes depending on configuration. None of these alone replaces a tested backup and recovery plan. Confirm access to the recovery data and test restoration to an isolated destination.
Compare deletion behavior carefully
In a versioning-enabled ordinary S3 bucket, deleting without a version ID generally installs a delete marker; earlier versions remain unless explicitly deleted or expired. Azure Blob versioning preserves earlier versions, and blob soft delete offers an additional recovery mechanism; blob versioning is not supported with hierarchical namespace enabled according to the checked documentation. Google Cloud Object Versioning can retain noncurrent generations, and soft delete can add another recovery stage. Do not assume an S3 delete marker exists in Azure or Google Cloud. Before recovery, identify the exact revision, retention constraints and required permission. Object Lock or bucket retention can block removal; irreversible locks need governance approval. Use version-specific documentation for the actual service and configuration.
Lifecycle rules are automated data decisions
A lifecycle rule selects data using conditions such as age, prefix or version state, then transitions storage class or expires eligible data. For our offline model, select noncurrent revisions older than or equal to 30 days, keep current revisions, and skip records protected by a hold. A 45-day noncurrent revision without a hold is eligible; a 10-day revision is not; a held revision is not. Eligibility is not an exact execution time. Real providers have different condition and action semantics and can process changes asynchronously. Review the candidate inventory before enabling any rule; apply only within approved scope. Distinguish expiration of objects, expiration of old versions and abortion of unfinished S3 multipart uploads. Include soft-deleted data, snapshots and replication copies in the cost and cleanup plan.
Compare storage tiers by total cost
Frequently accessed data generally favors a tier optimized for active reads. Less active and archival tiers may reduce storage rates while increasing retrieval cost, minimum storage duration charges or restore delays. AWS S3 storage classes, Azure Hot/Cool/Cold/Archive tiers and Google Cloud Standard/Nearline/Coldline/Archive classes are not one-to-one equivalents. For example, Azure Archive requires rehydration before normal reads, whereas Google Cloud Archive objects can be read directly with applicable retrieval charges. Verify latency and pricing for the specific service and location. In a fictional monthly model, 100 GB active data plus 20 GB retained versions at $0.02/GB-month costs $2.40; 2,000 requests at $0.005 per thousand cost $0.01; 10 GB transferred at $0.08/GB costs $0.80. Total: $3.21. A cheaper fictional tier at $0.01/GB-month with $0.05/GB retrieval of 20 GB would cost $3.01 with the same requests and transfer plus retrieval ($1.20 + $0.01 + $0.80 + $1.00). Compare against $3.21 only after checking retrieval latency, duration and excluded charges. These are invented rates, not provider quotes.
Review the bookstore retention plan
Keep current objects private; review noncurrent revisions at 30 days, keep protected records, and model restoration before any permanent deletion. Use the fixture to calculate the cost with and without old versions, classify token requests and identify which revision is eligible for cleanup. Include request types, data transfer, retrieval, incomplete uploads, minimum retention, replication, logs and taxes in a real estimate. Do not bypass retention or remove a real bucket to finish this exercise. Next: block, file and archival storage.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Object storage access and lifecycle — knowledge check
Choose the best answer for each offline scenario.
Which access pattern is appropriate for a private cover download?
The toy token permits GET until minute 10. Which request is allowed?
What is the best distinction between versioning and retention?
Which revision is eligible for the toy cleanup policy: noncurrent, at least 30 days old, not held?
100 GB active plus 20 GB versions at $0.02/GB-month, $0.01 requests and $0.80 transfer cost how much?