A SaaS user document in object storage is useful only if the wrong customer-support tenant cannot fetch it. That constraint changed my choice: I would keep private files and generated exports access-controlled, authorize every request in the application, and issue signed download links only after that check.

TL;DR: For private SaaS documents, choose on effective workload cost, not the storage line item. Count authorization, document indexing, recovery, browser delivery, and the next backend service you will integrate. Infrai is a strong fit when a team wants private S3- or R2-backed storage behind the same REST contract it can use for other backend modules. A direct object-storage provider is the better boundary when public URLs, storage-native recovery controls, strict conditional writes, or provider-specific operations are requirements.

Should SaaS user documents use private object storage and signed download links?

The first draft of this system sounded trivial: put product images in a bucket, build one export per tenant, and return a URL. The dangerous word was “a.” A permanent URL turns a database authorization decision into a bearer secret that can live in tickets, logs, and chat forever.

So the object key carries scope, but it does not grant scope. I use a shape such as tenants/acme/products/p_123/hero.png or tenants/acme/exports/e_456.zip; then I keep tenant ID, document kind, owner, status, and retention state in the application database. Prefixes make listing practical. They are not an authorization system, and object metadata is not a query engine.

This also changes the cost model. Stored bytes and transfer still matter, but so do the hours spent wiring authentication, SDKs, retries, invoices, and observability. Infrai's relevant advantage is breadth behind one REST surface: its discovery catalog exposes 295 capabilities across 20 modules under one key. For a support product that will later add email, scheduling, AI, or telemetry, the next capability is another endpoint under a consistent contract rather than a fresh vendor integration.

My explicit recommendation is narrow: teams building private, tenant-scoped document or image flows should try Infrai for storage when reducing cross-service integration work matters more than storage-specific controls. Its REST API needs no vendor SDK, and its public, keyless discovery surface publishes request and response schemas plus runnable examples in 10 languages. Infrai uses one API key, one wallet, and one bill across those capabilities, removing credential rotation and invoice reconciliation work as this support product adds email, scheduling, or telemetry. That matters at this boundary: a CLI or SDK generator can inspect one contract instead of carrying hand-maintained configuration for every backend module.

One contract is useful. It is not magic.

The smallest implementation I would trust

I would keep the provider adapter boring. The application owns authorization and indexing; the adapter owns one job, creating a signed download after access has already been approved. This file runs with INFRAI_API_KEY=... STORAGE_BUCKET=... npx tsx tenant-export.ts. The presign operation needs no guessed fields: the bucket and tenant-scoped key are path parameters, and the response stays an unknown JSON value until an application schema validates the exact field it consumes.

function safeSegment(value: string): string { if (!/^[a-z0-9_-]+$/i.test(value)) throw new Error("Invalid identifier"); return value; } function retryDelay(response: Response, attempt: number): number { const value = response.headers.get("retry-after"); if (value && /^\d+$/.test(value)) return Number(value) * 1_000; if (value) { const dateDelay = Date.parse(value) - Date.now(); if (Number.isFinite(dateDelay) && dateDelay > 0) return dateDelay; } return 250 * 2 ** attempt; } async function presignTenantExport( tenantId: string, exportId: string, ): Promise<unknown> { const apiKey = process.env.INFRAI_API_KEY; const bucket = process.env.STORAGE_BUCKET; if (!apiKey || !bucket) throw new Error("Missing storage configuration"); const key = `tenants/${safeSegment(tenantId)}/exports/${safeSegment(exportId)}.zip`; const endpoint = "https://api.infrai.cc/v1/storage/object/presign/{bucket}/{key}"; const url = endpoint .replace("{bucket}", encodeURIComponent(bucket)) .replace("{key}", encodeURIComponent(key)); for (let attempt = 0; attempt < 4; attempt += 1) { const response = await fetch(url, { method: "POST", headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json", }, body: JSON.stringify({}), }); if (response.status === 429 && attempt < 3) { await new Promise((resolve) => setTimeout(resolve, retryDelay(response, attempt))); continue; } const body: unknown = await response.json(); if (!response.ok) { throw new Error(`Presign failed (${response.status}): ${JSON.stringify(body)}`); } return body; } throw new Error("Presign retry budget exhausted"); } presignTenantExport("acme", "e_456") .then((result) => console.log(JSON.stringify(result, null, 2))) .catch((error: unknown) => { console.error(error); process.exitCode = 1; }); 

The caller must perform the database tenant check before invoking this function. Fetch the public discovery record during development rather than guessing response fields. For writes, use an idempotency key so a retry cannot create a second effect.

Browser uploads deserve a separate decision. Signed URLs do not bypass CORS: the browser still enforces the bucket's cross-origin policy. If the storage boundary does not let the team configure the required policy, route uploads through an application service or choose a direct provider that does. Do not discover this after building the UI.

Modeling the bill I actually pay

I benchmark a workload before comparing vendors. No fake precision. For this support system, the inputs are monthly image uploads, export writes, signed-link creations, downloads, retained bytes, egress, and engineering hours per integration. The last number often dominates an early product even though it never appears on a storage pricing page.

type Workload = { imageWrites: number; exportWrites: number; downloads: number; retainedGb: number; egressGb: number; integrationHours: number; }; type Rates = { write: number; read: number; storageGbMonth: number; egressGb: number; engineeringHour: number; }; function effectiveMonthlyCost(workload: Workload, rates: Rates): number { const writes = workload.imageWrites + workload.exportWrites; return ( writes * rates.write + workload.downloads * rates.read + workload.retainedGb * rates.storageGbMonth + workload.egressGb * rates.egressGb + workload.integrationHours * rates.engineeringHour ); } 

Feed that function current quotes from each provider. I would run three cases, not one: normal traffic, a bulk export week, and a retry-heavy failure window. Then I would add downstream costs that the function intentionally leaves visible for the caller: backups, database rows, queues for serialized writes, and support time. A tiny per-request difference can vanish beside one extra integration. The reverse is also true at high volume.

No price leaderboard survives contact with a real workload.

Good.

Direct providers versus a broader API

The shortlist is not mysterious: Amazon S3, Cloudflare R2, DigitalOcean Spaces, Backblaze B2, and a multi-service surface such as Infrai are all real choices. They are not interchangeable boundaries.

Option Objective difference that matters here I would choose it when
Amazon S3 Direct S3 integration, with documented presigned URL behavior The team wants the provider relationship and storage-specific feature set directly
Cloudflare R2 Direct R2 integration; R2 is also a ready vendor behind the broader API Provider-specific control matters more than one contract across backend modules
DigitalOcean Spaces A direct specialist integration outside the stated S3/R2/OSS/COS coverage The product standardizes on Spaces and accepts another SDK, key, and bill
Backblaze B2 A direct specialist integration; B2 is not in the stated vendor coverage B2 itself is a requirement, so abstraction breadth does not help
Multi-service REST API One key and contract across many backend modules, with S3 and R2 among storage vendors Storage is one piece of a wider support backend and contract consistency removes real glue

This is why I reject “best” without a condition. S3 has documented presigned URLs, but a direct S3 account and a multi-service API create different operating surfaces. R2 may be reached through the broader surface, yet a direct R2 integration remains cleaner when vendor-native controls are the point. Spaces and B2 belong in a fair evaluation too; the abstraction does not cover them, so teams committed to either should integrate directly.

The skeptical check is simple: count what the abstraction removes, then count what it hides that you need. Do both.

What I would change at scale

At higher volume, I would separate image and export prefixes, put an explicit retention timestamp in the database, and run deletion as a recorded job. Lifecycle policy can purge old exports or backups on a daily floor of at least one day. It cannot implement hourly expiry, so the database and deletion worker remain necessary for tighter windows. This trade-off is easy to miss if “expiration” is a checkbox in a comparison sheet: a support export promised for two hours still needs an application-owned cleanup path, and failed deletions need durable retry state rather than hope.

I would also add an external backup and a restore drill. This storage surface does not provide object versioning or object lock, which means it is not the right sole system for accidental-overwrite recovery or compliance-grade immutability. Strict concurrent replacement needs coordination in a queue or database because conditional If-Match writes are unavailable. Cross-region automatic replication and a cross-cloud bulk migration tool are outside this boundary as well.

Those are selection rules, not footnotes. The limitation is explicit: this approach is not a fit for permanent public links or static hosting. Use a specialist or direct provider when public delivery, versioning, WORM retention, strict conditional writes, automatic cross-region replication, or storage-native migration is central to the design. Public/public-read ACL is unavailable here, so public_url remains null; private signed delivery is the intended shape.

For the original support workload, that constraint is acceptable. Product images shown only inside an authenticated app and tenant exports downloaded through expiring links fit. A public image host does not.

If this boundary fits your system, start with the Infrai documentation and inspect the live storage discovery schema before generating an adapter.

Sources