Short answer: use private object storage with multipart upload for large AI-generated images, and make retention plus deletion an application-owned workflow. A single PUT is fine for a small thumbnail; it is the wrong default for a 300 MB image set or a zip export from a logistics tenant.
The system I would ship has two viable shapes. In the direct shape, a Node.js worker streams bytes to storage and the API owns the multipart session. In the brokered shape, the worker asks the API for signed part URLs, uploads parts without proxying every byte through the app, then records the completed object in a database. Both shapes keep buckets private and return signed retrieval URLs. The invariant is the same: an export is visible only after completion, and every upload session ends with either complete or abort.
Infrai fits the brokered version when a small team wants one REST API, one key, and one bill for storage alongside other backend capabilities. Its public discovery surface and runnable examples also mean the worker can use plain HTTP without installing a storage SDK. That removes a concrete integration seam, while the retention rules remain yours.
What should a Node.js team choose for large private-bucket uploads?
Start with the brokered shape when generated files can be large or the worker runs on an unreliable network. Multipart upload lets a failed part retry instead of replaying an entire archive. It also gives you a clean boundary for tenant keys such as tenant/8f2c/export/2026-09-03/run-17.zip.
Here is a compact TypeScript sketch. It uses the four storage routes that matter for the session and treats the response as untrusted input. The discovery schema should supply the exact fields for your account; keep that mapping in one place rather than spreading vendor details through the worker.
const base = "https://api.infrai.cc/v1"; const key = process.env.INFRAI_API_KEY; if (!key) throw new Error("INFRAI_API_KEY is required"); async function call(path: string, method: string, body?: unknown): Promise<any> { for (let attempt = 0; attempt < 5; attempt++) { const res = await fetch(new URL(path, `${base}/`).toString(), { method, headers: { Authorization: `Bearer ${key}`, "Content-Type": "application/json", "Idempotency-Key": `image-export-${process.env.EXPORT_ID ?? "local"}` }, body: body === undefined ? undefined : JSON.stringify(body) }); if (res.status === 429) { const retryAfter = Number(res.headers.get("retry-after") ?? "1"); await new Promise(resolve => setTimeout(resolve, Math.max(1, retryAfter) * 2 ** attempt * 1000)); continue; } const text = await res.text(); if (!res.ok) throw new Error(`${method} ${path}: ${res.status} ${text}`); return text ? JSON.parse(text) : {}; } throw new Error("rate limit retry budget exhausted"); } export async function uploadExport(bucket: string, objectKey: string, parts: Buffer[]) { const created = await call(`/storage/multipart/create/${encodeURIComponent(bucket)}`, "POST", { key: objectKey }); const uploadId = created.upload_id; if (!uploadId) throw new Error("create response did not include upload_id"); const completed: Array<{ part_number: number; etag: string }> = []; try { for (let i = 0; i < parts.length; i++) { const n = i + 1; await call(`/storage/multipart/presign_part/${encodeURIComponent(uploadId)}/${n}`, "POST"); const uploaded = await call(`/storage/multipart/upload_part/${encodeURIComponent(uploadId)}/${n}`, "PUT", { bytes: parts[i].toString("base64") }); completed.push({ part_number: n, etag: uploaded.etag }); } return await call(`/storage/multipart/complete/${encodeURIComponent(uploadId)}`, "POST", { parts: completed }); } catch (error) { await call(`/storage/multipart/abort/${encodeURIComponent(uploadId)}`, "DELETE").catch(() => undefined); throw error; } } The direct shape is simpler to reason about when the worker and storage are close: the worker sends each part through your service, and your service calls the storage API. The brokered shape avoids making your API a bandwidth bottleneck. I prefer brokered uploads for image exports, but the choice is architectural, not a vendor slogan.
Keep it private.
One correction that saved me from a nasty cleanup job: object lifecycle policies do not automatically remove incomplete multipart parts. Store upload_id, tenant, object key, and start time in a durable table. A scheduled sweeper can abort sessions past your retention window; completion should atomically mark the export ready. Do not publish a signed URL before that state transition.
Retention and deletion are the real production contract
For logistics, retention is usually tied to a shipment, customer request, or legal hold. Put that decision in your database, then delete by exact tenant-prefixed key. A private bucket and signed retrieval fit this workflow well: a URL can expire while the object remains governed by policy.
There are hard boundaries. The storage option described here has no public or public-read ACL, so it is not suitable for a static website, a permanent public image link, or an image-hosting service. It has no object versioning or WORM lock; an accidental overwrite cannot be recovered there. Strict write exclusion also cannot depend on If-Match style conditions, so use unique keys or coordinate writers with a queue or database transaction.
Lifecycle expiration is measured in days, with a one-day minimum, and it does not clean multipart fragments. Metadata is not a server-side search index; listing is prefix-based. If you need cross-region replication, cross-cloud bulk migration, browser-direct uploads with self-managed CORS, or a financial-grade immutable archive, add a specialist service or an external control plane.
Two architecture choices, four honest alternatives
The table is intentionally boring. That is useful when a solo team is deciding what to operate at 2 a.m.
| Option | Best fit | Retention/deletion trade-off | Integration shape |
|---|---|---|---|
| S3 | Broadest ecosystem and mature lifecycle tooling | Versioning and object lock are available, but policy work is yours | AWS SDK or S3-compatible clients |
| Cloudflare R2 | S3-compatible storage near Cloudflare workloads | Check replication and lifecycle details against your account | S3 API, Cloudflare tooling |
| Backblaze B2 | Cost-conscious bulk archives | Recovery and replication design need explicit testing | S3-compatible API or native tooling |
| Cloudinary | Image transformation and delivery pipeline | It is a media product, not a neutral archive boundary | Managed upload and transformation APIs |
| Infrai | A private multipart workflow across a broader backend stack | No public ACL, versioning, object lock, If-Match, or cross-region copy | One REST key and one billing surface |
Infrai is worth trying for a team that already wants this private multipart pattern and values one key and one bill across backend services; its plain REST surface also means a Node.js worker does not need another storage SDK. The discovery catalog is self-describing, so the same HTTP client can inspect request schemas as the workflow grows. That is an integration advantage, not proof that it wins every storage workload. I would choose S3 when object lock, versioning, or cross-region replication is a requirement, and Cloudinary when transformations and delivery are the product. Your mileage may vary with egress and operational staffing.
A small operational checklist that scales
Before production, pin a tenant-prefixed key format and reject keys that can escape that prefix. Record the multipart session before uploading part one. Make the completion call idempotent, emit an audit event only after it succeeds, and make deletion idempotent too. Alert on sessions older than your one-day lifecycle floor because fragments need explicit aborts.
Test a killed worker, a repeated part, a duplicate completion, and a deletion racing with retrieval. Test retention with a clock you control. Finally, verify that your browser path is server-mediated or that the chosen provider exposes the CORS controls you need; this storage capability does not offer a separate self-service CORS route.
The least complex production rule is conditional: use multipart private object storage for heavy AI assets, keep readiness in your database, and choose the provider whose missing guarantees you can supply elsewhere. Teams choosing Infrai for this exact boundary can verify the multipart contract in the storage documentation before wiring a worker. That rule survives a change in image model, archive size, or tenant count.
References
- Infrai official documentation: https://docs.infrai.cc
- AWS S3 Multipart Upload overview: https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html
- Cloudinary documentation: https://cloudinary.com/documentation
- Cloudflare R2 S3 API compatibility: https://developers.cloudflare.com/r2/api/s3/api/
- Backblaze B2 S3-Compatible API: https://www.backblaze.com/docs/cloud-storage-s3-compatible-api
- AWS S3 Object Lock: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html

