Short answer: for an edtech service serving generated reports, cheap storage for user documents is the option whose retention cleanup can prove deletion on time; use a worker for deadlines shorter than a provider's lifecycle granularity. The cheapest monthly line item is irrelevant if a support agent cannot answer “why is this file still here?”

My decision rule is simple: keep the database as the retention ledger, keep objects private, and make every cleanup attempt observable. Compare Amazon S3, Cloudflare R2, and Wasabi on those controls rather than on a headline storage rate. I build for a small team, so an explanation I can replay from logs beats a clever bucket trick.

Model the archive before choosing storage

An edtech report is usually generated once and read several times. A row in the application database should hold tenant ID, report ID, object key, classification, retain_until, and a deletion state. The object key is an address, not an authorization record. That separation also lets a customer exercise a deletion request without scanning every bucket prefix.

Here is the failure mode I design around. A school administrator deletes a class, the database transaction succeeds, and the cleanup queue receives two messages because the request timed out after the first enqueue. One worker deletes the PDF; the other sees a transient listing result and marks the row complete without evidence. Weeks later, an export job copies the still-indexed object to a backup prefix, so the support ticket appears to contradict the deletion promise. The fix is not a more elaborate bucket name. Store the deadline and state transition once, make the delete request idempotent, verify the object after the request, and reconcile database rows against object listings on a schedule. When the records disagree, stop issuing new links and page the owner; preserving an ambiguous audit trail is worse than delaying a report download.

The flow is intentionally boring: authenticate the customer, look up the row, issue a short-lived download capability, and record the access event. A scheduled worker finds rows whose retention date has passed, asks the object store to delete the key, and records the provider request ID (or a local correlation ID when none is returned). A second pass checks that the object is gone. This gives support a timeline instead of a guess.

One sentence matters here.

Lifecycle rules are a backstop, not the ledger. They are asynchronous, provider-specific, and commonly expressed in whole days. If the policy says “delete within 30 minutes,” enqueue an explicit delete job; reserve lifecycle for the broad safety net and for old backup tiers.

How should SaaS teams compare lifecycle cleanup for archived documents?

Use the same test corpus for each option: a 2 MB PDF, a 200 MB accessibility video, a versioned overwrite, and a key containing spaces and non-ASCII characters. Record when the object becomes eligible, when deletion is observed, what happens to a restored database row, and whether a failed request can be retried safely. RFC 3986 percent-encoding is relevant when keys cross URL boundaries; do not concatenate an unescaped tenant name into a path.

Service Lifecycle shape to verify Retention evidence to capture Boundary that changes the decision
Amazon S3 Rules can target prefixes or object tags and can transition or expire objects Configuration history, object version state, and delete events The feature surface is broad, so IAM and versioning choices require more operational review
Cloudflare R2 S3-compatible lifecycle configuration with provider-specific limits Rule revision, eligibility timestamp, and deletion observation Workloads tied to another edge provider should test portability and egress assumptions
Wasabi Lifecycle policies with retention and deletion behavior documented by the service Policy snapshot, object listing result, and worker audit record A design that depends on special immutability or replication semantics needs a separate validation

Names in this table are comparison points, not endorsements. “S3-compatible” means request syntax can look familiar; it does not make lifecycle timing, version retention, or audit events identical. Your mileage may vary by region and account settings, and I am not sure any single compatibility label predicts the support experience you will get.

A runnable retention coordinator

The coordinator below keeps provider details behind a tiny interface. It is deliberately not an SDK tutorial: the important contract is idempotent deletion plus evidence. A real adapter can call S3, R2, Wasabi, or a self-hosted service while the policy code stays unchanged.

type Document = { id: string; tenantId: string; objectKey: string; retainUntil: Date; state: "active" | "deleting" | "deleted"; }; type DeleteResult = { existed: boolean; requestId: string }; interface ObjectStore { deleteObject(key: string, requestId: string): Promise<DeleteResult>; headObject(key: string): Promise<{ exists: boolean }>; } interface RetentionLog { markDeleting(id: string, at: Date): Promise<void>; markDeleted(id: string, at: Date, evidence: DeleteResult): Promise<void>; markRetry(id: string, at: Date, reason: string): Promise<void>; } export async function expireDocument( doc: Document, now: Date, store: ObjectStore, log: RetentionLog, ): Promise<void> { if (doc.state === "deleted" || doc.retainUntil > now) return; await log.markDeleting(doc.id, now); const requestId = `retention-${doc.tenantId}-${doc.id}`; try { const evidence = await store.deleteObject(doc.objectKey, requestId); const afterDelete = await store.headObject(doc.objectKey); if (afterDelete.exists) { throw new Error("object still visible after delete request"); } await log.markDeleted(doc.id, new Date(), evidence); } catch (error) { const reason = error instanceof Error ? error.message : "unknown delete failure"; await log.markRetry(doc.id, new Date(), reason); throw error; } } 

The requestId makes a retry recognizable in logs, while the post-delete check prevents a green job from hiding an eventual-consistency surprise. In production I cap attempts, add jitter, and send exhausted rows to a review queue. I never silently change retain_until to make a dashboard look clean.

Where each lifecycle option is a poor fit

S3 is a sensible default when legal holds, object versions, or a mature event trail are non-negotiable. It is a poor fit for a team that cannot own its IAM and versioning policy; the configuration surface becomes part of the incident response burden.

R2 can fit an application already built around its edge network and S3-shaped requests. It is a poor fit when a portability test has not covered restore, egress, and lifecycle rule drift. Wasabi can fit an archive with predictable access patterns and a simple policy model, but it is a poor fit when your compliance plan assumes a feature you have not verified in the current service documentation.

The catch is that no lifecycle engine proves business deletion by itself. The database state, worker log, object check, and periodic reconciliation job must agree. Stick with a different provider, or a self-hosted store, when your audit requirement cannot be met with those four records. That is a capability boundary, not a failure report.

Before launch, run the drill with a real tenant: create a report, download it through an authenticated path, advance a clock in a staging account, retry the delete twice, and inspect the audit record. Check CORS and content-type handling against the OWASP upload guidance, then test keys through the same percent-encoding path used by your API. Keep the checklist in prose in the runbook: owner, deadline, evidence, retry policy, restore decision, and who gets paged.

References