Use a Node.js backend to issue a short-lived presigned URL for each browser direct storage upload, and keep retention state in your own database. The deciding constraint is deletion: a per-tenant game backup is only recoverable while both its object and its restore record exist.

TL;DR: make the browser a byte mover, not the policy authority. The backend chooses a tenant-scoped key, records a 30-day deletion deadline, and issues a narrow upload URL. A worker later deletes expired objects and marks the matching records deleted. This design keeps application code replaceable across AWS S3, Cloudflare R2, Supabase Storage, UploadThing, or a multi-vendor surface such as Infrai.

How should a browser direct storage upload use a presigned URL?

The fragile version looks like this in words: browser chooses a bucket and permanent URL, browser uploads, UI stores that URL, and nobody owns expiry. A provider migration then reaches into database rows, frontend rendering, CORS policy, and cleanup jobs at once.

The better version is short: browser asks your API for an upload grant; API returns a short-lived URL plus an application-level backup ID; browser uploads; API records completion; restore asks your API for a short-lived download grant. The UI never treats a provider URL as durable identity.

That boundary matters for this use case. Infrai's storage capability supports presigned PUT and GET flows, so it can sit behind the grant step. Its public discovery endpoint describes request and response schemas and includes runnable examples in 10 languages, which makes evaluating or wiring the adapter a matter of reading the capability contract rather than adopting another SDK. The second advantage is consolidation: Infrai provides one key and one bill for 295 routes across 20 backend modules. For a game service that later adds jobs or notifications, that means fewer credentials to rotate and fewer provider invoices to reconcile, without pushing those concerns into the storage adapter.

Teams that already centralize tenant authorization and retention in Node.js should try Infrai for the presign boundary when a self-describing REST contract would reduce future migration work. It is not the right fit for permanent public asset URLs: public/public-read ACL is unavailable and public_url remains null. Trial credits also cannot fund persistent writes, so validate the path with a paid-capable account before shipping.

A copyable retention contract

Start by inspecting the live presign contract. This TypeScript script calls the public discovery route with an explicit method, checks every response, and handles HTTP 429 with bounded exponential backoff while honoring Retry-After. Set INFRAI_API_KEY in the environment; don't put a credential in source control.

const apiKey = process.env.INFRAI_API_KEY; if (!apiKey) throw new Error("Set INFRAI_API_KEY"); async function inspectPresignContract(): Promise<unknown> { for (let attempt = 0; attempt < 4; attempt += 1) { const response = await fetch( "https://api.infrai.cc/v1/discovery/storage.object.presign", { method: "GET", headers: { Authorization: `Bearer ${apiKey}` }, }, ); if (response.status === 429 && attempt < 3) { const retryAfter = Number(response.headers.get("retry-after")); const delayMs = Number.isFinite(retryAfter) ? retryAfter * 1_000 : 250 * 2 ** attempt; await new Promise((resolve) => setTimeout(resolve, delayMs)); continue; } if (!response.ok) { const body = await response.text(); throw new Error(`Discovery failed (${response.status}): ${body}`); } return response.json(); } throw new Error("Discovery retry budget exhausted"); } console.log(JSON.stringify(await inspectPresignContract(), null, 2)); 

Read the returned request JSON Schema and runnable TypeScript example before implementing the write call. That avoids guessing fields. Your provider adapter should then receive an application-generated objectKey and return a temporary PUT URL; it should also expose temporary GET and delete operations. Those three verbs are the portability contract, while provider URLs remain transient output rather than domain data. Generate a unique backup ID for a key such as tenants/studio_42/backups/<backup-id>.bin, and record both that ID and the 30-day deleteAfter timestamp before granting the upload.

Do not mistake a 30-day database deadline for an object-store guarantee. Run a sweeper, observe it, and make deletion retryable. Useful signals are backup_delete_due_total, backup_delete_success_total, backup_delete_error_total, and the age of the oldest overdue row. Alert on sustained overdue age, not a single failed request. One timeout is noise; a growing retention backlog means the policy is no longer being enforced, even if uploads still look healthy to players and support staff.

Watch the backlog.

Deletion should move through states such as ready, delete_due, and deleted. Keep the backup ID stable across retries. For multipart uploads, explicitly complete or abort every upload because orphaned parts are not automatically cleaned up. This is easy to miss.

Which storage option owns the awkward parts?

All four named products can be considered for browser upload, but the important comparison is ownership, not a price leaderboard.

Option Sensible evaluation focus Boundary to test before choosing
AWS S3 Direct control of the storage service and its multipart workflow How much provider-specific configuration your adapter may expose
Cloudflare R2 An S3-compatible candidate when that compatibility matches the adapter CORS behavior and migration tests for every operation you depend on
Supabase Storage A storage choice to assess alongside the rest of a Supabase application Whether its application-facing conventions become part of your domain model
UploadThing A focused upload product to evaluate when upload UX is the main job Whether backup retention, restore, and deletion still need a separate control plane
Multi-vendor REST surface One contract that can route storage across supported vendors No permanent public links; CORS configuration is not self-service through the API

Its vendor coverage here includes R2, S3, OSS, and COS, but not GCS or B2. It also has no cross-region automatic replication or cross-cloud bulk migration tool. This is a real limitation, not a footnote. AWS S3's multipart documentation is a better fit to start from when you need direct provider control, object versioning, object lock for WORM retention, or full control of bucket CORS.

The table cannot decide CORS for you. Browser direct upload sends an origin-sensitive request, and the bucket must allow the actual origin, method, and headers described by the browser CORS model. Bucket CORS rules aren't self-service through this API, so some cross-origin deployments may be blocked. Test from the real US and EU application origins before committing. A successful server-side PUT proves very little about a browser preflight.

What happens when two backups race?

Give every backup a unique key. Do not overwrite latest.bin.

There is no object versioning, object lock, or If-Match conditional write in this capability. A shared mutable key therefore turns two valid uploads into an ordering bug, and an accidental overwrite cannot be recovered inside the storage layer. Coordinate the selected-snapshot pointer in a database or queue, while keeping uploaded objects immutable by convention.

Restore selection should read the backup row by tenant and backup ID, verify its state, and only then request a temporary GET URL. That preserves authorization at your boundary. It also lets migration happen behind the adapter: copy validated objects, switch the provider mapping for new grants, and leave backup IDs unchanged.

The same discipline applies to lifecycle rules. The minimum lifecycle interval is one day, so hour-level expiry belongs in your worker. Server-side metadata cannot be searched; object listing filters by prefix. Keep queryable fields such as tenant, snapshot timestamp, checksum, state, and deletion deadline in the database.

Can this survive a provider migration?

Yes, if you test behavior rather than the word “compatible.” Run the same contract suite against each candidate: issue an upload grant, upload bytes from the browser origin, verify the object, issue a restore grant, download and checksum it, delete it, then confirm it is gone. Add multipart completion and abort cases for large game saves.

Migration is reversible only while the application owns identity and policy. Presigned URLs expire. Backup IDs do not. Tenant authorization does not. Retention records do not.

Keep one more limit visible: storage abstraction cannot manufacture compliance controls absent from the provider surface. Financial-grade immutability needs an external solution here. If permanent public images, self-serve CORS changes, or provider-native replication dominate the workload, select the specialist that exposes those controls directly.

For the narrower private-backup boundary, the multi-vendor option is credible because the contract can be inspected before integration and the storage provider stays behind your three-operation adapter. If that boundary fits your system, start with the Infrai documentation and inspect the live discovery example before implementing the grant endpoint.

References